From 7379c5be8a5cebcef69a03fa41f44dfe1b87e9b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com>
Date: Thu, 4 May 2023 13:41:59 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=B7=A5=E4=BD=9C=E7=A5=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../operational/station/entity/StationEntity.java | 1 +
.../fallback/StationFeginServiceFallback.java | 10 +
.../ticket/fegin/StationFeginService.java | 16 +
.../workTicket/entity/WorkTicketInfoEntity.java | 395 +++++++++---
.../entity/WorkTicketSafetyMeasureEntity.java | 1 +
.../operational/station/feign/StationClient.java | 5 +
hzims-service/ticket/pom.xml | 13 +
.../hnac/hzims/ticket/config/Swagger2Config.java | 60 ++
.../hzims/ticket/processflow/CodeGenerator.java | 4 +-
.../constant/TicketProcessConstant.java | 2 +-
.../controller/ProcessTypeController.java | 2 +-
.../processflow/strategy/core/ProcessIdWorker.java | 343 ++++++-----
.../serviceimpl/MakeProcessServiceImpl.java | 4 +-
.../ticket/response/ProcessWorkFlowResponse.java | 4 +-
.../controller/StandardWorkTicketController.java | 3 +-
.../controller/TicketProcessController.java | 49 ++
.../controller/WorkTicketFinishController.java | 20 +
.../ticket/twoTicket/entity/WorkTicketFinish.java | 146 +++++
.../twoTicket/enums/FlowWorkTicketConstants.java | 97 +++
.../twoTicket/enums/TwoWorkTicketStatusEnum.java | 62 ++
.../twoTicket/mapper/WorkTicketFinishMapper.java | 17 +
.../twoTicket/mapper/WorkTicketFinishMapper.xml | 5 +
.../service/IWorkTicketFinishService.java | 16 +
.../twoTicket/service/TicketProcessService.java | 9 +-
.../service/impl/FirstWorkTicketServiceImpl.java | 1 +
.../service/impl/TicketProcessServiceImpl.java | 674 ++++++++++++++++++---
.../service/impl/WorkTicketFinishServiceImpl.java | 20 +
.../twoTicket/vo/process/SafetyMeasuresVo.java | 14 +-
.../ticket/twoTicket/vo/process/TeamGroupVo.java | 51 +-
.../twoTicket/vo/process/TeamPersonnelVo.java | 23 +-
.../ticket/twoTicket/vo/process/WorkTicketVo.java | 147 +----
.../workTicket/service/IWorkTicketInfoService.java | 9 +
.../service/impl/WorkTicketInfoServiceImpl.java | 18 +
.../src/main/resources/file/工作票.bpmn20.xml | 198 +++---
.../main/resources/file/新工作票.bpmn20.xml | 165 +++--
.../hnac/hzims/ticket/TicketApplicationTest.java | 7 +
36 files changed, 1961 insertions(+), 650 deletions(-)
create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ticket/fallback/StationFeginServiceFallback.java
create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ticket/fegin/StationFeginService.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/config/Swagger2Config.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/WorkTicketFinishController.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/enums/FlowWorkTicketConstants.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/enums/TwoWorkTicketStatusEnum.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketFinishMapper.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketFinishMapper.xml
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IWorkTicketFinishService.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
index 4468b3b..1253b7c 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
@@ -52,6 +52,7 @@ public class StationEntity extends TenantEntity implements Serializable {
@QueryField(condition = SqlCondition.EQUAL)
private String areaCode;
+
@ApiModelProperty("上属机构")
@QueryField(condition = SqlCondition.EQUAL)
private Long higherDept;
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ticket/fallback/StationFeginServiceFallback.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ticket/fallback/StationFeginServiceFallback.java
new file mode 100644
index 0000000..284f4b6
--- /dev/null
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ticket/fallback/StationFeginServiceFallback.java
@@ -0,0 +1,10 @@
+package com.hnac.hzims.operational.ticket.fallback;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/4/26 15:04
+ */
+public class StationFeginServiceFallback {
+}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ticket/fegin/StationFeginService.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ticket/fegin/StationFeginService.java
new file mode 100644
index 0000000..4a4ae29
--- /dev/null
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ticket/fegin/StationFeginService.java
@@ -0,0 +1,16 @@
+package com.hnac.hzims.operational.ticket.fegin;
+
+import com.hnac.hzims.operational.ticket.fallback.StationFeginServiceFallback;
+import org.springframework.cloud.openfeign.FeignClient;
+
+import static com.hnac.hzims.operational.OperationalConstants.APP_NAME;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/4/26 15:03
+ */
+//@FeignClient(value = APP_NAME,fallback = StationFeginServiceFallback.class)
+public interface StationFeginService {
+}
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
index a07e66f..fc2293a 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
@@ -25,136 +25,369 @@ import org.springframework.format.annotation.DateTimeFormat;
*/
@Data
@EqualsAndHashCode(callSuper = false)
-@ApiModel(value = "工作票对象",description = "工作票对象")
+@ApiModel(value = "工作票对象", description = "工作票对象")
@TableName("hzims_work_ticket_info")
public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
- private static final long serialVersionUID=1L;
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 工作流ID
+ */
@ApiModelProperty(value = "工作流ID")
- @QueryField(condition = SqlCondition.EQUAL)
+ @QueryField(condition = SqlCondition.EQUAL)
private String processInstanceId;
+
+ /**
+ * 附页第几章
+ */
+ @ApiModelProperty("附页第几章")
+ private Integer followerNum;
+
+
+ /**
+ * 设备code
+ */
@ApiModelProperty(value = "设备code")
- @QueryField(condition = SqlCondition.EQUAL)
+ @QueryField(condition = SqlCondition.EQUAL)
private String emCode;
+ /**
+ * 设备名称
+ */
@ApiModelProperty(value = "设备名称")
- @QueryField(condition = SqlCondition.LIKE)
+ @QueryField(condition = SqlCondition.LIKE)
private String emName;
- @ApiModelProperty(value = "工作票类型")
- @QueryField(condition = SqlCondition.EQUAL)
+ /**
+ * 工作票类型
+ */
+ @ApiModelProperty(value = "工作票类型")
+ @QueryField(condition = SqlCondition.EQUAL)
private String type;
- @ApiModelProperty(value = "单位")
- @QueryField(condition = SqlCondition.LIKE)
+
+ /**
+ * 票据模板
+ */
+ @ApiModelProperty("票据模板")
+ private String ticketTemplate;
+
+
+ /**
+ * 单位
+ */
+ @ApiModelProperty(value = "单位")
+ @QueryField(condition = SqlCondition.LIKE)
private String company;
- @ApiModelProperty(value = "编号")
- @QueryField(condition = SqlCondition.LIKE)
+
+ /**
+ * 编号
+ */
+ @ApiModelProperty(value = "编号")
+ @QueryField(condition = SqlCondition.LIKE)
private String code;
- @ApiModelProperty(value = "关联业务类型")
- @QueryField(condition = SqlCondition.EQUAL)
+
+ /**
+ * 关联业务类型
+ */
+ @ApiModelProperty(value = "关联业务类型")
+ @QueryField(condition = SqlCondition.EQUAL)
private String taskType;
- @ApiModelProperty(value = "关联业务ID")
- @QueryField(condition = SqlCondition.EQUAL)
- @JsonSerialize(nullsUsing = NullSerializer.class)
+
+ /**
+ * 关联业务ID
+ */
+ @ApiModelProperty(value = "关联业务ID")
+ @QueryField(condition = SqlCondition.EQUAL)
+ @JsonSerialize(nullsUsing = NullSerializer.class)
private Long taskId;
- @ApiModelProperty("关联业务名称")
- @QueryField(condition = SqlCondition.LIKE)
- private String taskName;
+ /**
+ * 关联业务名称
+ */
+ @ApiModelProperty("关联业务名称")
+ @QueryField(condition = SqlCondition.LIKE)
+ private String taskName;
+
+ /**
+ * 班组
+ */
@ApiModelProperty(value = "班组")
- @JsonSerialize(nullsUsing = NullSerializer.class)
+ @JsonSerialize(nullsUsing = NullSerializer.class)
private Long classGroup;
+
+ /**
+ * 班组名称
+ */
@ApiModelProperty("班组名称")
private String classGroupName;
- @ApiModelProperty(value = "班组成员")
+
+ /**
+ * 班组成员
+ */
+ @ApiModelProperty(value = "班组成员")
private String classGroupMembers;
- @ApiModelProperty(value = "班组成员手填")
- private String classGroupMembersManual;
- @ApiModelProperty(value = "工作地点及设备名称")
+ /**
+ * 班组成员手填
+ */
+ @ApiModelProperty(value = "班组成员手填")
+ private String classGroupMembersManual;
+
+
+ /**
+ * 班组成员名称
+ */
+ @ApiModelProperty(value = "班组成员名称")
+ private String classGroupMembersName;
+
+
+ /**
+ * 工作地点及设备名称
+ */
+ @ApiModelProperty(value = "工作地点及设备名称")
private String addressEquName;
- @ApiModelProperty(value = "工作任务及内容")
+
+ /**
+ * 工作任务及内容
+ */
+ @ApiModelProperty(value = "工作任务及内容")
private String workContent;
- @ApiModelProperty(value = "计划开始时间")
- @DateTimeFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
- @JsonFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
+
+ /**
+ * 计划开始时间
+ */
+ @ApiModelProperty(value = "计划开始时间")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime planStartTime;
- @ApiModelProperty(value = "计划结束时间")
- @DateTimeFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
- @JsonFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
+ /**
+ * 计划结束时间
+ */
+ @ApiModelProperty(value = "计划结束时间")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime planEndTime;
- @ApiModelProperty(value = "签发人")
- @JsonSerialize(nullsUsing = NullSerializer.class)
+
+ /**
+ * 签发人
+ */
+ @ApiModelProperty(value = "签发人")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
private Long signer;
- @ApiModelProperty(value = "负责人")
- @JsonSerialize(nullsUsing = NullSerializer.class)
+
+ /**
+ * 签发人签发时间
+ */
+ @ApiModelProperty(value = "签发人签发时间")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private LocalDateTime signerDateTime;
+
+
+ /**
+ * 负责人
+ */
+ @ApiModelProperty(value = "负责人")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
private Long principal;
- @ApiModelProperty(value = "手填值班负责人")
- private String principalManual;
+ /**
+ * 手填值班负责人
+ */
+ @ApiModelProperty(value = "手填值班负责人")
+ private String principalManual;
+
+
+ /**
+ * 负责人名称
+ */
+ @ApiModelProperty(value = "负责人名称")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private String principalName;
+
- @ApiModelProperty(value = "许可人")
- @JsonSerialize(nullsUsing = NullSerializer.class)
+ /**
+ * 许可人
+ */
+ @ApiModelProperty(value = "许可人")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
private Long licensor;
- @ApiModelProperty(value = "许可时间")
- @DateTimeFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
- @JsonFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
+ /**
+ * 许可时间
+ */
+ @ApiModelProperty(value = "许可时间")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime licenseTime;
- @ApiModelProperty("工作负责人确认工作完成上传图片地址")
- private String confirmImgUrls;
-
- @ApiModelProperty("工作负责人确认工作完成上传图片名称")
- private String confirmImgFilenames;
-
- @DateTimeFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
- @JsonFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
- @ApiModelProperty("工作负责人确认工作完成时间")
- private LocalDateTime confirmWorkTime;
-
- @DateTimeFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
- @JsonFormat(
- pattern = "yyyy-MM-dd HH:mm:ss"
- )
- @ApiModelProperty(value = "许可人确认工作结束时间")
- private LocalDateTime licenseEndTime;
-
- @ApiModelProperty("是否评价")
- @JsonSerialize(nullsUsing = NullSerializer.class)
- private Integer isEvaluate;
+
+ /**
+ * 工作负责人确认工作完成上传图片地址
+ */
+ @ApiModelProperty("工作负责人确认工作完成上传图片地址")
+ private String confirmImgUrls;
+
+ /**
+ * 工作负责人确认工作完成上传图片名称
+ */
+ @ApiModelProperty("工作负责人确认工作完成上传图片名称")
+ private String confirmImgFilenames;
+
+
+ /**
+ * 工作负责人确认工作完成时间
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty("工作负责人确认工作完成时间")
+ private LocalDateTime confirmWorkTime;
+
+
+ /**
+ * 许可人确认工作结束时间
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty(value = "许可人确认工作结束时间")
+ private LocalDateTime licenseEndTime;
+
+
+ @ApiModelProperty("是否评价")
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ private Integer isEvaluate;
+
+
+ /**
+ * 值班负责人
+ */
+ @ApiModelProperty("值班负责人")
+ private Long watchPrincipal;
+
+
+ /**
+ * 批准工作结束时间
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty("批准工作结束时间")
+ private LocalDateTime watchPrincipalEndTime;
+
+
+ /**
+ * 开工时间
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty("开工时间")
+ private LocalDateTime startDateTime;
+
+
+ /**
+ * 收工时间
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty("收工时间")
+ private LocalDateTime endDateTime;
+
+
+ /**
+ * 工作票结束时间
+ */
+ @ApiModelProperty("工作票结束时间")
+ private LocalDateTime workTicketEndTime;
+
+
+ /**
+ * 备注
+ */
+ @ApiModelProperty("备注")
+ private String content;
+
+
+ /**
+ * 交底内容
+ */
+ @ApiModelProperty("交底内容")
+ private String tellContent;
+
+
+ /**
+ * 工作条件(false 停电 true 不停电)
+ */
+ @ApiModelProperty("工作条件(false 停电 true 不停电)")
+ private Boolean isPower;
+
+
+ /**
+ * 流程状态'
+ */
+ @ApiModelProperty("流程状态")
+ private Integer flowStatus;
+
+ /**
+ * 流程描述
+ */
+ @ApiModelProperty("流程描述")
+ private String flowDescription;
+
+
+ /**
+ * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性
+ * 站点标识-两票编码
+ */
+ @ApiModelProperty("站点标识-两票编码")
+ private String signage;
+
+
+ /**
+ * 编号(原站点ID)
+ */
+ @ApiModelProperty("编号(原站点ID)")
+ private String signageCode;
+
+
+ /**
+ * 开票时间
+ */
+ @ApiModelProperty("开票时间")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private LocalDateTime makeDateTime;
+ /**
+ * 共几人
+ */
+ @ApiModelProperty("共几人")
+ private Integer totalPerson;
+
+
+ /**
+ * 负责人确认安全措施时间
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private LocalDateTime confirmDateTime;
+
+
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private LocalDateTime issuerReviewDateTime;
}
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketSafetyMeasureEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketSafetyMeasureEntity.java
index 956ffd1..cd4b164 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketSafetyMeasureEntity.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketSafetyMeasureEntity.java
@@ -93,4 +93,5 @@ public class WorkTicketSafetyMeasureEntity extends TenantEntity implements Seria
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer sort;
+
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java
index 48644d6..e96e54a 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java
@@ -128,6 +128,11 @@ public class StationClient implements IStationClient {
return R.data(stationService.getOne(request));
}
+
+
+
+
+
@Override
@PostMapping("/getStationByCodeOrRedDept")
@ApiOperation("根据条件查询单个站点")
diff --git a/hzims-service/ticket/pom.xml b/hzims-service/ticket/pom.xml
index 0685ea8..4169881 100644
--- a/hzims-service/ticket/pom.xml
+++ b/hzims-service/ticket/pom.xml
@@ -20,6 +20,7 @@
3.15
3.2.0
1.0.3
+ 1.9.6
@@ -277,6 +278,18 @@
+
+
+
+ com.github.xiaoymin
+ swagger-bootstrap-ui
+ ${swagger-bootstrap-ui.version}
+
+
+
+ com.hnac.hzims
+ hzims-operational-api
+
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/config/Swagger2Config.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/config/Swagger2Config.java
new file mode 100644
index 0000000..6299226
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/config/Swagger2Config.java
@@ -0,0 +1,60 @@
+package com.hnac.hzims.ticket.config;
+
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
+import com.google.common.base.Predicates;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/4/13 13:40
+ */
+//@Configuration
+//@EnableSwagger2
+public class Swagger2Config implements WebMvcConfigurer {
+
+
+ @Override
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
+ registry.addResourceHandler("/**")
+ .addResourceLocations("classpath:/static/");
+ registry.addResourceHandler("doc.html")
+ .addResourceLocations("classpath:/META-INF/resources/");
+ registry.addResourceHandler("/webjars/**")
+ .addResourceLocations("classpath:/META-INF/resources/webjars/");
+ }
+
+
+
+ @Bean
+ public Docket webApiConfig(){
+ return new Docket(DocumentationType.SWAGGER_2)
+ .groupName("工作票")
+ .apiInfo(webApiInfo())
+ .select()
+ //只显示api路径下的页面
+ .paths(Predicates.and(PathSelectors.regex("/ticket-process/.*")))
+ .build();
+
+ }
+
+ private ApiInfo webApiInfo() {
+ return new ApiInfoBuilder()
+ .title("网站-API文档")
+ .description("本文档描述了网站微服务接口定义")
+ .version("1.0")
+ .contact(new Contact("WL", "http://localhost:8501/", "55317332@qq.com"))
+ .build();
+ }
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java
index 7693224..b797501 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java
@@ -42,7 +42,7 @@
//
// // 包配置
// PackageConfig pc = new PackageConfig();
-// pc.setModuleName("processflow");
+// pc.setModuleName("p");
// pc.setParent("com.hnac.hzims.ticket");
// mpg.setPackageInfo(pc);
//
@@ -93,7 +93,7 @@
// // strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// // 写于父类中的公共字段
// // strategy.setSuperEntityColumns("id");
-// strategy.setInclude("hzims_process_type");
+// strategy.setInclude("hzims_work_ticket_finish");
// strategy.setControllerMappingHyphenStyle(true);
// strategy.setTablePrefix("hzims_");
// mpg.setStrategy(strategy);
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java
index d161a4f..f37dcae 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java
@@ -11,5 +11,5 @@ package com.hnac.hzims.ticket.processflow.constant;
public class TicketProcessConstant {
// public final static String STARTEVENT = "startEvent1";
- public final static String STARTEVENT = "newFirstWorkTicket";
+ public final static String STARTEVENT = "workTicket";
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java
index 80d39e0..8e22483 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java
@@ -107,7 +107,7 @@ public class ProcessTypeController {
workTicketMessageResponse.setTaskId("1");
workTicketMessageResponse.setProcessDefinitionKey("newFirstWorkTicket");
workTicketMessageResponse.setTaskName("签发人签发");
- workTicketMessageResponse.setFormData("1");
+ workTicketMessageResponse.setVariables("1");
String qqqq = JsonUtil.toJson(workTicketMessageResponse);
queueProduceService.sendMessage("blade:queue:flow", qqqq);
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java
index e29a875..6fcddf2 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java
@@ -3,12 +3,15 @@ package com.hnac.hzims.ticket.processflow.strategy.core;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import java.text.NumberFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
@@ -22,166 +25,190 @@ import java.util.concurrent.atomic.AtomicInteger;
* @Serial 1.0
* @Date 2023/3/27 10:11
*/
+@Slf4j
@Component
public class ProcessIdWorker {
- private static Map cacheMap = new HashMap<>();
-
-
- @Autowired
- private StringRedisTemplate redisTemplate;
-
- private static NumberFormat numberFormatter;
-
-
- static {
- //初始化
- numberFormatter = NumberFormat.getInstance();
- numberFormatter.setGroupingUsed(false);
- numberFormatter.setMinimumIntegerDigits(3);
- numberFormatter.setMaximumFractionDigits(3);
- }
-
- /**
- * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式
- *
- * @param staff AA在建站之初由接站人员填写要求唯一
- * @param typeInstrument 票据种类,第一种票,第二种票
- * @param yearMonth 开票时间年月
- */
- public String getTicketCode(String staff, String typeInstrument, String yearMonth) {
- ValueOperations operations = redisTemplate.opsForValue();
- AtomicInteger atomicInteger = new AtomicInteger(1);
- String key = staff + ":" + typeInstrument + ":" + yearMonth;
- // TicketCode ticketCode1 = cacheMap.get(key);
- TicketCode ticketCode = JSON.parseObject(operations.get(key), TicketCode.class);
- if (ticketCode == null) {
- ticketCode = new TicketCode();
- ticketCode.setYearMonth(yearMonth);
- ticketCode.setSequencing(atomicInteger);
- // cacheMap.put(key, ticketCode);
- operations.set(key, JSON.toJSONString(ticketCode));
- String result = getTicketCode(staff, typeInstrument, yearMonth, atomicInteger.get());
- return result;
- }
-
- String originalYearMonth = ticketCode.getYearMonth();
-
- AtomicInteger sequencing = ticketCode.getSequencing();
-
- //生成 票据排序 格式 001 010 111
- int code = getYearMonthCode(originalYearMonth, yearMonth, key, sequencing);
-
- String result = getTicketCode(staff, typeInstrument, yearMonth, code);
- return result;
- }
-
-
- /**
- * 生成的票据 编号
- */
- public String getTicketCode(String staff, String typeInstrument, String YearMonth, int sequencing) {
- return staff.concat("-").concat(typeInstrument).concat("-").concat(YearMonth).concat("-").concat(numberFormatter.format(sequencing));
- }
-
-
- /**
- * 返回票据排序
- *
- * @param
- * @param originalYearMonth 上次的年月 年的后2位 + 月
- * @param nextYearMonth 现在的年月 年的后2位 + 月
- * @param key
- * @param sequencing
- * @return
- */
- private int getYearMonthCode(String originalYearMonth, String nextYearMonth, String key, AtomicInteger sequencing) {
- ValueOperations operations = redisTemplate.opsForValue();
- //1. 累计票据
- sequencing.incrementAndGet();
- //3. 判断年是否为空
- if (StringUtils.isEmpty(originalYearMonth) && StringUtils.isEmpty(nextYearMonth)) {
- return sequencing.get();
- }
- //4. 验证年 最后一位数
- String year1 = getSubstring(originalYearMonth, 1);
- String year2 = getSubstring(nextYearMonth, 1);
- if (!year1.equals(year2)) {
- sequencing.compareAndSet(sequencing.get(), 1);
- return sequencing.get();
- }
-
- //4. 验证倒数第二位数
- year1 = getSubstring(originalYearMonth, 2);
- year2 = getSubstring(nextYearMonth, 2);
- if (!year1.equals(year2)) {
- sequencing.compareAndSet(sequencing.get(), 1);
- return sequencing.get();
- }
-
- //4. 验证倒数第三位数
- year1 = getSubstring(originalYearMonth, 3);
- year2 = getSubstring(nextYearMonth, 3);
- if (!year1.equals(year2)) {
- sequencing.compareAndSet(sequencing.get(), 1);
- return sequencing.get();
- }
-
-
- //6. sequencing 大于等于1000 的话,从头开始
- if (sequencing.get() >= 1000) {
- sequencing.compareAndSet(sequencing.get(), 1);
- System.out.println("sequencing >= 1000 被执行呢");
- redisTemplate.delete(key);
- // cacheMap.remove(key);
- return sequencing.get();
- }
-
- TicketCode ticketCode = new TicketCode();
- ticketCode.setYearMonth(nextYearMonth);
- ticketCode.setSequencing(sequencing);
- operations.set(key, JSON.toJSONString(ticketCode));
- //cacheMap.put(key, ticketCode);
-
- return sequencing.get();
- }
-
- /**
- * 截取字符串
- *
- * @param originalYearMonth
- * @param digit 位数
- * @return
- */
- private static String getSubstring(String originalYearMonth, int digit) {
- return originalYearMonth.substring(originalYearMonth.length() - digit);
- }
-
-
- /**
- * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式
- * @param staff AA在建站之初由接站人员填写要求唯一
- * @param typeInstrument 票据种类,第一种票,第二种票
- * @param year 年
- * @param month 月
- * @return
- */
- public String getTicketCode(String staff, String typeInstrument, String year,String month){
- String yearMonth = year.substring(year.length() - 2) + month;
- return getTicketCode(staff,typeInstrument,yearMonth);
- }
-
- @Data
- public static class TicketCode {
-
- /**
- * 月份
- */
- private String yearMonth;
- /**
- * 记录数
- */
- private AtomicInteger sequencing = new AtomicInteger(1);
- }
+ private static Map cacheMap = new HashMap<>();
+
+
+ @Autowired
+ private StringRedisTemplate redisTemplate;
+
+ private static NumberFormat numberFormatter;
+
+
+ static {
+ //初始化
+ numberFormatter = NumberFormat.getInstance();
+ numberFormatter.setGroupingUsed(false);
+ numberFormatter.setMinimumIntegerDigits(3);
+ numberFormatter.setMaximumFractionDigits(3);
+ }
+
+ /**
+ * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式
+ *
+ * @param staff AA在建站之初由接站人员填写要求唯一
+ * @param typeInstrument 票据种类,第一种票,第二种票
+ * @param yearMonth 开票时间年月
+ */
+ private String getTicketCode(String staff, String typeInstrument, String yearMonth) {
+ ValueOperations operations = redisTemplate.opsForValue();
+ AtomicInteger atomicInteger = new AtomicInteger(1);
+ String key = staff + ":" + typeInstrument + ":" + yearMonth;
+ // TicketCode ticketCode1 = cacheMap.get(key);
+ TicketCode ticketCode = JSON.parseObject(operations.get(key), TicketCode.class);
+ if (ticketCode == null) {
+ ticketCode = new TicketCode();
+ ticketCode.setYearMonth(yearMonth);
+ ticketCode.setSequencing(atomicInteger);
+ // cacheMap.put(key, ticketCode);
+ operations.set(key, JSON.toJSONString(ticketCode));
+ String result = getTicketCode(staff, typeInstrument, yearMonth, atomicInteger.get());
+ return result;
+ }
+
+ String originalYearMonth = ticketCode.getYearMonth();
+
+ AtomicInteger sequencing = ticketCode.getSequencing();
+
+ //生成 票据排序 格式 001 010 111
+ int code = getYearMonthCode(originalYearMonth, yearMonth, key, sequencing);
+ //获取编码信息
+ String result = getTicketCode(staff, typeInstrument, yearMonth, code);
+ log.info("获取编码信息 {}", result);
+ return result;
+ }
+
+
+ /**
+ * 生成的票据 编号
+ */
+ private String getTicketCode(String staff, String typeInstrument, String YearMonth, int sequencing) {
+ return staff.concat("-").concat(typeInstrument).concat("-").concat(YearMonth).concat("-").concat(numberFormatter.format(sequencing));
+ }
+
+
+ /**
+ * 返回票据排序
+ *
+ * @param
+ * @param originalYearMonth 上次的年月 年的后2位 + 月
+ * @param nextYearMonth 现在的年月 年的后2位 + 月
+ * @param key
+ * @param sequencing
+ * @return
+ */
+ private int getYearMonthCode(String originalYearMonth, String nextYearMonth, String key, AtomicInteger sequencing) {
+ ValueOperations operations = redisTemplate.opsForValue();
+ //1. 累计票据
+ sequencing.incrementAndGet();
+ //3. 判断年是否为空
+ if (StringUtils.isEmpty(originalYearMonth) && StringUtils.isEmpty(nextYearMonth)) {
+ return sequencing.get();
+ }
+ //4. 验证年 最后一位数
+ String year1 = getSubstring(originalYearMonth, 1);
+ String year2 = getSubstring(nextYearMonth, 1);
+ if (!year1.equals(year2)) {
+ sequencing.compareAndSet(sequencing.get(), 1);
+ return sequencing.get();
+ }
+
+ //4. 验证倒数第二位数
+ year1 = getSubstring(originalYearMonth, 2);
+ year2 = getSubstring(nextYearMonth, 2);
+ if (!year1.equals(year2)) {
+ sequencing.compareAndSet(sequencing.get(), 1);
+ return sequencing.get();
+ }
+
+ //4. 验证倒数第三位数
+ year1 = getSubstring(originalYearMonth, 3);
+ year2 = getSubstring(nextYearMonth, 3);
+ if (!year1.equals(year2)) {
+ sequencing.compareAndSet(sequencing.get(), 1);
+ return sequencing.get();
+ }
+
+
+ //6. sequencing 大于等于1000 的话,从头开始
+ if (sequencing.get() >= 1000) {
+ sequencing.compareAndSet(sequencing.get(), 1);
+ System.out.println("sequencing >= 1000 被执行呢");
+ redisTemplate.delete(key);
+ // cacheMap.remove(key);
+ return sequencing.get();
+ }
+
+ TicketCode ticketCode = new TicketCode();
+ ticketCode.setYearMonth(nextYearMonth);
+ ticketCode.setSequencing(sequencing);
+ operations.set(key, JSON.toJSONString(ticketCode));
+ //cacheMap.put(key, ticketCode);
+
+ return sequencing.get();
+ }
+
+ /**
+ * 截取字符串
+ *
+ * @param originalYearMonth
+ * @param digit 位数
+ * @return
+ */
+ private static String getSubstring(String originalYearMonth, int digit) {
+ return originalYearMonth.substring(originalYearMonth.length() - digit);
+ }
+
+
+ /**
+ * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式
+ *
+ * @param staff AA在建站之初由接站人员填写要求唯一
+ * @param typeInstrument 票据种类,第一种票,第二种票
+ * @param year 年
+ * @param month 月
+ * @return
+ */
+ private String getTicketCode(String staff, String typeInstrument, String year, String month) {
+ String yearMonth = year.substring(year.length() - 2) + month;
+ return getTicketCode(staff, typeInstrument, yearMonth);
+ }
+
+
+ /**
+ * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式
+ *
+ * @param staff AA在建站之初由接站人员填写要求唯一
+ * @param typeInstrument 票据种类,第一种票,第二种票
+ * @param createTime 开票时间 YYYY-MM-dd HH:mm:ss
+ * @return
+ */
+ public String getTicketByCode(String staff, String typeInstrument, LocalDateTime createTime) {
+ DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+ String format = createTime.format(dateTimeFormatter);
+ String year = format.substring(0, 4);
+ log.info("获取年份信息: {}", year);
+ String month = format.substring(5, 7);
+ log.info("获取月份信息: {}", month);
+ return getTicketCode(staff, typeInstrument, year, month);
+ }
+
+
+ @Data
+ public static class TicketCode {
+
+ /**
+ * 月份
+ */
+ private String yearMonth;
+ /**
+ * 记录数
+ */
+ private AtomicInteger sequencing = new AtomicInteger(1);
+ }
+
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java
index cf40c11..cb5f248 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java
@@ -8,6 +8,7 @@ import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -54,7 +55,6 @@ public class MakeProcessServiceImpl extends ProcessAbstractService {
*/
@Override
public void calculate(ProcessWorkFlowResponse response) {
- log.info("启动开票流程环节....");
- ticketProcessService.startUp(response);
+ ticketProcessService.findPending(response);
}
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java
index 8e4dcbf..f32345e 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java
@@ -45,7 +45,9 @@ public class ProcessWorkFlowResponse implements Serializable {
*/
private String nextStepOperator;
+
+
/**票据表单**/
- private String formData;
+ private String variables;
}
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
index 9fa6697..986749b 100644
--- 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
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
+import java.time.LocalDateTime;
import java.util.List;
/**
@@ -70,7 +71,7 @@ public class StandardWorkTicketController {
@ApiOperation("测试生成唯一编码")
@GetMapping("/idWored")
public R idWored() {
- String ticketCode = standardTicketIdWorker.getTicketCode("aa", "bb", "2304");
+ String ticketCode = standardTicketIdWorker.getTicketByCode("aa", "bb", LocalDateTime.now());
return R.data(ticketCode);
}
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
new file mode 100644
index 0000000..7d0030b
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
@@ -0,0 +1,49 @@
+package com.hnac.hzims.ticket.twoTicket.controller;
+
+import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService;
+import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.Tag;
+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.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 WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/4/23 10:34
+ */
+@Slf4j
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "新工作票")
+@RequestMapping("/ticket-process")
+public class TicketProcessController {
+
+
+ @Autowired
+ private TicketProcessService ticketProcessService;
+
+
+ /**
+ * 启动流程
+ * @return
+ */
+ @ApiOperation("启动流程")
+ @PostMapping("/startUp")
+ public R start(@RequestBody WorkTicketVo workTicketVo) {
+ ticketProcessService.startUp(workTicketVo);
+ return R.success("启动流程成功");
+ }
+
+
+
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/WorkTicketFinishController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/WorkTicketFinishController.java
new file mode 100644
index 0000000..80ce24f
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/WorkTicketFinishController.java
@@ -0,0 +1,20 @@
+package com.hnac.hzims.ticket.twoTicket.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *
+ * 工作结束 前端控制器
+ *
+ *
+ * @author dfy
+ * @since 2023-04-24
+ */
+@RestController
+@RequestMapping("/p/work-ticket-finish")
+public class WorkTicketFinishController {
+
+}
+
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java
new file mode 100644
index 0000000..e201719
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java
@@ -0,0 +1,146 @@
+package com.hnac.hzims.ticket.twoTicket.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *
+ * 工作结束
+ *
+ *
+ * @author dfy
+ * @since 2023-04-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("hzims_work_ticket_finish")
+public class WorkTicketFinish implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ /**
+ * 编号
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 工作票编号
+ */
+ @ApiModelProperty("工作票编号")
+ @TableField("ticket_id")
+ private Long ticketId;
+
+ /**
+ * 临时接地线
+ */
+ @ApiModelProperty("临时接地线")
+ @TableField("temp_ground_num")
+ private Integer tempGroundNum;
+
+ /**
+ * 临时拆除几组
+ */
+ @ApiModelProperty("临时拆除几组")
+ @TableField("temp_dismantle_num")
+ private Integer tempDismantleNum;
+
+ /**
+ * 接地线几组
+ */
+ @ApiModelProperty("接地线几组")
+ @TableField("ground_num")
+ private Integer groundNum;
+
+ /**
+ * 拆除几组
+ */
+ @ApiModelProperty("拆除几组")
+ @TableField("dismantle_num")
+ private Integer dismantleNum;
+
+ /**
+ * 保留几组
+ */
+ @ApiModelProperty("拆除几组")
+ @TableField("retain_num")
+ private Integer retainNum;
+
+
+ /**
+ * 创建时间
+ */
+ @ApiModelProperty("创建时间")
+ @TableField("create_time")
+ private LocalDateTime createTime;
+
+ /**
+ * 更新时间
+ */
+ @ApiModelProperty("更新时间")
+ @TableField("update_time")
+ private LocalDateTime updateTime;
+
+ /**
+ * 负责人名称
+ */
+ @ApiModelProperty("负责人名称")
+ @TableField("principal")
+ private Long principal;
+
+
+
+ /**
+ * 许可人
+ */
+ @ApiModelProperty("许可人")
+ @TableField("licensor")
+ private Long licensor;
+
+
+
+ /**
+ * 负责人工作结束时间
+ */
+ @ApiModelProperty("负责人工作结束时间")
+ private LocalDateTime principalEndTime;
+
+
+ /**
+ * 工作票终结时间
+ */
+ @ApiModelProperty("工作票终结时间")
+ private LocalDateTime licensorEndTime;
+
+
+ /**
+ * 结束时间
+ */
+ private LocalDateTime workEndTime;
+
+
+
+ /**
+ * 备注
+ */
+ @ApiModelProperty("备注")
+ private String content;
+
+ /**
+ * 交底内容
+ */
+ @ApiModelProperty("交底内容")
+ private String tellContent;
+
+
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/enums/FlowWorkTicketConstants.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/enums/FlowWorkTicketConstants.java
new file mode 100644
index 0000000..6c84698
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/enums/FlowWorkTicketConstants.java
@@ -0,0 +1,97 @@
+package com.hnac.hzims.ticket.twoTicket.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.Optional;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/3/24 11:34
+ */
+public enum FlowWorkTicketConstants {
+ /**
+ * 开票
+ */
+ START(1, "开票"),
+ /**
+ * 签发人签发
+ */
+ SIGN(2, "签发人签发"),
+ /**
+ * 运行人员接收
+ */
+ RECEIVE(3,"运行人员接收"),
+ /**
+ * 运行人员布置安全措施
+ */
+ FIX_UP(4 ,"运行人员布置安全措施"),
+ /**
+ * 工作负责人确认安全措施
+ */
+ PRINCIPAL_CONFIRM_MEASURE(5 ,"工作负责人确认安全措施"),
+
+ /**
+ * 许可人许可
+ */
+ LICENCE(6,"许可人许可"),
+
+
+
+ /**
+ * 工作负责人确认工作内容执行
+ */
+ PRINCIPAL_CONFIRM_CONTENT(6, "工作负责人确认工作内容执行"),
+
+ /**
+ * 工作负责人确认工作票结束
+ */
+ PRINCIPAL_CONFIRM_END(7, "工作负责人确认工作票结束、终结"),
+
+
+ /**
+ * 许可人确认工作票结束
+ */
+ LICENSE_CONFIRM_END(9, "许可人确认工作票结束、终结"),
+
+ /**
+ * 签发人审核
+ */
+ SIGN_CONFIRM_DELAY(10, "签发人审核"),
+
+ /**
+ * 工作票转移
+ */
+ PROCESS_COURSE(12 , "工作票转移"),
+ /**
+ * 工作票延期
+ */
+ PROCESS_POSTPONE(13, "工作票延期"),
+
+ /**
+ * 结束
+ */
+ END(14,"流程结束");
+
+ @Getter
+ private Integer status;
+
+ @Getter
+ private String description;
+
+ FlowWorkTicketConstants(Integer status, String description) {
+ this.status = status;
+ this.description = description;
+ }
+
+
+ public static FlowWorkTicketConstants getEnumByStatus(Integer status) {
+ Optional statusOptional = Arrays.stream(FlowWorkTicketConstants.class.getEnumConstants())
+ .filter(e -> status.equals(e.getStatus())).findAny();
+ return statusOptional.orElse(null);
+ }
+
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/enums/TwoWorkTicketStatusEnum.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/enums/TwoWorkTicketStatusEnum.java
new file mode 100644
index 0000000..b72b77c
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/enums/TwoWorkTicketStatusEnum.java
@@ -0,0 +1,62 @@
+package com.hnac.hzims.ticket.twoTicket.enums;
+
+import com.hnac.hzims.ticket.constants.WorkTicketConstants;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.Optional;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/4/24 17:19
+ */
+@AllArgsConstructor
+public enum TwoWorkTicketStatusEnum {
+
+ /**签发**/
+ SIGN(1,"签发"),
+ /**收到工作票**/
+ RECEIVE(2,"收到工作票"),
+ /**许可人许可**/
+ LICENSE(3,"许可人许可"),
+ /**确认条件具备**/
+ CONFIRM_MEASURE(4,"确认条件具备"),
+ /**工作负责人确认工作**/
+ CONFIRM_WORK(5,"工作负责人确认工作"),
+ /**许可人确认工作结束**/
+ WORK_FINISH(6,"许可人确认工作结束"),
+ /**工作票终结**/
+ TICKET_FINISH(7,"工作票终结"),
+ /**结束**/
+ FINISH(8,"结束"),
+ /**许可人延期确认**/
+ LICENSE_DELAY(9,"许可人延期确认"),
+ /**负责人延期确认**/
+ CONFIRM_DELAY(10,"负责人延期确认"),
+ /**作废**/
+ INVALID(11,"作废"),
+ /**逾期**/
+ OVERDUE(12,"逾期"),
+ /**线下开票**/
+ OFFLINE(13,"线下开票"),
+ /**线下执行任务**/
+ OFFLINE_OPERATE(14,"线下执行任务"),
+ /**线下许可人许可**/
+ OFFLINE_LICENSE(15,"线下许可人许可"),
+ /**线下结束**/
+ OFFLINE_END(16,"线下结束")
+ ;
+ @Getter
+ private Integer status;
+ @Getter
+ private String description;
+
+ public static WorkTicketConstants.FirstWorkTicketStatusEnum getEnumByStatus(Integer status) {
+ Optional statusOptional = Arrays.stream(WorkTicketConstants.FirstWorkTicketStatusEnum.class.getEnumConstants())
+ .filter(e-> status.equals(e.getStatus())).findAny();
+ return statusOptional.orElse(null);
+ }
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketFinishMapper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketFinishMapper.java
new file mode 100644
index 0000000..398cb8f
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketFinishMapper.java
@@ -0,0 +1,17 @@
+package com.hnac.hzims.ticket.twoTicket.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish;
+
+/**
+ *
+ * 工作结束 Mapper 接口
+ *
+ *
+ * @author dfy
+ * @since 2023-04-24
+ */
+public interface WorkTicketFinishMapper extends BaseMapper {
+
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketFinishMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketFinishMapper.xml
new file mode 100644
index 0000000..0b73df2
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketFinishMapper.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IWorkTicketFinishService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IWorkTicketFinishService.java
new file mode 100644
index 0000000..43bdf90
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IWorkTicketFinishService.java
@@ -0,0 +1,16 @@
+package com.hnac.hzims.ticket.twoTicket.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish;
+
+/**
+ *
+ * 工作结束 服务类
+ *
+ *
+ * @author dfy
+ * @since 2023-04-24
+ */
+public interface IWorkTicketFinishService extends IService {
+
+}
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 0c134f2..2d0005e 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,6 +1,7 @@
package com.hnac.hzims.ticket.twoTicket.service;
import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse;
+import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
/**
* 开票处理流程接口
@@ -13,7 +14,13 @@ public interface TicketProcessService {
/**
* 启动开票流程
+ */
+ void startUp(WorkTicketVo workTicketVo);
+
+
+ /**
+ * 待处理
* @param response
*/
- void startUp(ProcessWorkFlowResponse response);
+ void findPending(ProcessWorkFlowResponse response);
}
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 59e0853..b207705 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
@@ -788,6 +788,7 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl map = new HashMap(){{
- put("key",true);
- }};
+ private final ProcessIdWorker processIdWorker;
+
+
+ private final IFirstWorkTicketService firstWorkTicketService;
+
+
+ private final IWorkTicketSafetyMeasureService workTicketSafetyMeasureService;
+
+
+ private final IWorkTicketContentService contentService;
+
+
+ private final IUserClient userClient;
+
+
+ private final IOperAccessTaskClient operAccessTaskClient;
+
+
+ private final ITaskClient taskClient;
+
+
+ private final IAccessTaskClient accessTaskClient;
+
+ private String newFirstWorkTicketFlowKey = "workTicket";
+
+
+ private final IStationClient stationClient;
+
+
+ private final WorkTicketOperateTimeServiceImpl workTicketOperateTimeServiceImpl;
+
+
+ private final IWorkTicketFinishService workTicketFinishService;
+
+ private final WorkTicketDelayServiceImpl workTicketDelayService;
+
+
+ private final IWorkTicketPrincipalChangeService workTicketPrincipalChangeService;
+
/**
* 启动开票流程
*
+ * @param workTicketVo
+ */
+ @Override
+ @Transactional
+ public void startUp(WorkTicketVo workTicketVo) {
+ if (workTicketVo.getWorkTicket().getSignage() == null) {
+ throw new ServiceException("站点标识-两票编码不能为空");
+ }
+ //1. 获取站点站点标识-两票编码
+ StationEntity stationEntity = new StationEntity();
+ stationEntity.setCode(workTicketVo.getWorkTicket().getSignageCode());
+ R stationClientOne = stationClient.getOne(stationEntity);
+ if (!stationClientOne.isSuccess()) {
+ throw new IllegalArgumentException("根据条件获取唯一站点出错呢");
+ }
+ StationEntity station = stationClientOne.getData();
+ if (station == null) {
+ throw new ServiceException("根据条件获取唯一站点暂无数据");
+ }
+
+ log.info("前端查的站点编号 :{}",workTicketVo.getWorkTicket().getSignage());
+ log.info("后端查寻的站点编码 :{}",station.getSignage());
+ if (!workTicketVo.getWorkTicket().getSignage().equals(station.getSignage())) {
+ throw new ServiceException("获取唯一站点不一致");
+ }
+ String signage =
+ station.getSignage().length() == 2 ?
+ station.getSignage() : station.getSignage().substring(0, 2);
+
+ workTicketVo.getWorkTicket().setSignage(signage);
+ workTicketVo.getWorkTicket().setSignageCode(station.getCode());
+ //2. 获取编码
+ String code = processIdWorker.getTicketByCode(workTicketVo.getWorkTicket().getSignage(), workTicketVo.getWorkTicket().getType(), workTicketVo.getWorkTicket().getMakeDateTime());
+ workTicketVo.getWorkTicket().setCode(code);
+ //3 .保存工作对象
+ this.saveWorkTicketInfo(workTicketVo.getWorkTicket());
+ //4. 保存安全措施
+ this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket());
+ //5. 保存工作任务
+ this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket());
+ //6. 开启动作流
+ this.dealProcess(newFirstWorkTicketFlowKey, workTicketVo);
+ }
+
+ /**
+ * 待处理
+ *
* @param response
*/
@Override
- public void startUp(ProcessWorkFlowResponse response) {
+ public void findPending(ProcessWorkFlowResponse response) {
+ //json转换表单
+ String formData = response.getVariables();
+ WorkTicketVo workTicketVo = JSON.parseObject(formData, WorkTicketVo.class);
+ WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+ //2.流程处理
+ Integer flowStatus = workTicket.getFlowStatus();
+ FlowWorkTicketConstants enumByStatus = FlowWorkTicketConstants.getEnumByStatus(flowStatus);
+ switch (enumByStatus) {
+ // case START:
+ // //开票
+ // make(response, workTicketVo);
+ // break;
+ case SIGN:
+ //签发人签发
+ //工作票签发人默认执行
+ sign(response, workTicketVo);
+ break;
+ case RECEIVE:
+ //运功人接收
+ reception(response, workTicketVo);
+ break;
+ case FIX_UP:
+ // 运行人员布置安全措施
+ safety(response, workTicketVo);
+ break;
+ case PRINCIPAL_CONFIRM_MEASURE:
+ //工作负责人确认安全措施
+ principal(response, workTicketVo);
+ break;
+ case LICENCE:
+ //许可人许可
+ license(response, workTicketVo);
+ break;
+ case PRINCIPAL_CONFIRM_CONTENT:
+ //工作负责人确认工作内容执行
+ principalConfirmContent(response, workTicketVo);
+ break;
+ case PRINCIPAL_CONFIRM_END:
+ //工作负责人确认工作票结束
+ principalConfirmEnd(response, workTicketVo);
+ break;
+ case LICENSE_CONFIRM_END:
+ //许可人确认工作票结束
+ licenseConfirmEnd(response, workTicketVo);
+ break;
+ case PROCESS_POSTPONE:
+ //工作票延期
+ processPostpone(response, workTicketVo);
+ break;
+ case PROCESS_COURSE:
+ //工作票转移
+ processCourse(response,workTicketVo);
+ break;
+ case SIGN_CONFIRM_DELAY:
+ //签发人审核
+ signConfirmDelay(response,workTicketVo);
+ break;
+ }
+ }
- Boolean key = map.get("key");
- //当前环节Id
- String processDefinitionKey = response.getProcessDefinitionKey();
- //当前任务Id
- String taskId = response.getTaskId();
- //表单数据
- String formData = response.getFormData();
- log.info("当前任务ID:{},当前流程定义ID:{},启动开票流程", taskId, processDefinitionKey);
- System.out.println(formData);
+ /**
+ * 签发人审核
+ * @param response
+ * @param workTicketVo
+ */
+ private void signConfirmDelay(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) {
+ WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+ workTicket.setFlowStatus(FlowWorkTicketConstants.LICENCE.getStatus());
+ workTicket.setFlowDescription(FlowWorkTicketConstants.LICENCE.getDescription());
+ workTicketInfoService.updateById(workTicket);
- // Map variables = new HashMap<>();
- // variables.put("task_id", taskId);
- // variables.put("signUserIds", formData);
- if (key) {
- Map params = new HashMap(2) {{
- put("taskId", "4066d774-df2c-11ed-b33e-fa163ee12c20");
- put("signUserIds", "1377143375838359553");
- }};
+ }
- R processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(
- processDefinitionKey, "workTicket:task:" + 1377143375838359553L,
- "开启工作的任务",
- params);
+ /**
+ * 工作票转移
+ * @param response
+ * @param workTicketVo
+ */
+ private void processCourse(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) {
+ //工作票负责人变更
+ WorkTicketPrincipalChangeEntity workTicketPrincipalChange = workTicketVo.getWorkTicketPrincipalChange();
+ workTicketPrincipalChangeService.save(workTicketPrincipalChange);
+ //更新工作票信息
+ WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+ workTicket.setFlowStatus(FlowWorkTicketConstants.SIGN_CONFIRM_DELAY.getStatus());
+ workTicket.setFlowDescription(FlowWorkTicketConstants.SIGN_CONFIRM_DELAY.getDescription());
+ workTicketInfoService.updateById(workTicket);
- if (processInstanceContainNameByKey.getCode() != 200) {
- log.error("启动开票流程失败: {}", processInstanceContainNameByKey);
- return;
- }
- BladeFlow bladeFlow = processInstanceContainNameByKey.getData();
- log.info("bladeFlow: {}", bladeFlow);
- map.put("key",false);
+ }
+
+
+ /**
+ * 工作票延期
+ *
+ * @param response
+ * @param workTicketVo
+ */
+ private void processPostpone(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) {
+ //保存工作票延期
+ WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay();
+ workTicketDelayService.save(workTicketDelay);
+ //更新工作票信息
+ WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+ workTicket.setFlowStatus(FlowWorkTicketConstants.LICENCE.getStatus());
+ workTicket.setFlowDescription(FlowWorkTicketConstants.LICENCE.getDescription());
+ workTicketInfoService.updateById(workTicket);
+
+ }
+
+
+ /**
+ * 许可人确认工作票结束
+ *
+ * @param response
+ * @param workTicketVo
+ */
+ private void licenseConfirmEnd(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) {
+ //工作结束
+ WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish();
+ workTicketFinishService.updateById(workTicketFinish);
+ //更新工作票信息
+ WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+ workTicket.setFlowStatus(FlowWorkTicketConstants.END.getStatus());
+ workTicket.setFlowDescription(FlowWorkTicketConstants.END.getDescription());
+ workTicketInfoService.updateById(workTicket);
+ }
+
+
+ /**
+ * 工作负责人确认工作票结束
+ *
+ * @param response
+ * @param workTicketVo
+ */
+ private void principalConfirmEnd(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) {
+ //工作结束
+ WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish();
+ workTicketFinishService.save(workTicketFinish);
+ //更新工作票信息
+ WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+ workTicket.setFlowStatus(FlowWorkTicketConstants.LICENSE_CONFIRM_END.getStatus());
+ workTicket.setFlowDescription(FlowWorkTicketConstants.LICENSE_CONFIRM_END.getDescription());
+ workTicketInfoService.updateById(workTicket);
+ }
+
+
+ /**
+ * 工作负责人确认工作内容执行
+ *
+ * @param response
+ * @param workTicketVo
+ */
+ private void principalConfirmContent(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) {
+ List workTicketOperateTimeEntities = workTicketVo.getWorkTicketOperateTimeEntities();
+ if (CollectionUtils.isEmpty(workTicketOperateTimeEntities)) {
+ log.info("暂时没有每日开工每日收的数据");
+ return;
+ }
+ workTicketOperateTimeServiceImpl.saveBatch(workTicketOperateTimeEntities);
+ //更新工作票信息
+ WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket();
+ workTicket.setFlowStatus(FlowWorkTicketConstants.PRINCIPAL_CONFIRM_END.getStatus());
+ workTicket.setFlowDescription(FlowWorkTicketConstants.PRINCIPAL_CONFIRM_END.getDescription());
+ workTicketInfoService.updateById(workTicket);
+ }
+
+ /**
+ * 许可人许可
+ *
+ * @param response
+ * @param workTicketVo
+ */
+ private void license(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) {
+ List safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
+ if (CollectionUtils.isEmpty(safetyMeasuresList)) {
+ log.error("没有安全措施数据");
return;
}
+ //更新安全措施的状态
+ List workTicketSafetyMeasureEntities = new ArrayList<>();
+ for (WorkTicketSafetyMeasureDto workTicketSafetyMeasureDto : safetyMeasuresList) {
+ WorkTicketSafetyMeasureEntity workTicketSafetyMeasureEntity = BeanUtil.copyProperties(workTicketSafetyMeasureDto, WorkTicketSafetyMeasureEntity.class);
+ workTicketSafetyMeasureEntities.add(workTicketSafetyMeasureEntity);
+ }
+ workTicketSafetyMeasureService.saveBatch(workTicketSafetyMeasureEntities);
- // R tasks = flowClient.getTaskByProcessInstanceIdAndUserId(response.getProcessInstanceId(),
- // "1377143375838359553");
- //
- //
- // flowClient.getTaskByProcessInstanceIdAndUserId(response.getProcessInstanceId(),
- // "1377143375838359553");
- //
- // if (tasks.getCode() != 200){
- // return;
- // }
- //
- // BladeFlow bladeFlow1 = tasks.getData();
- //
- // String curStep = bladeFlow1.getCurStep();
- // System.out.println("curStep = " + curStep);
- //
- // String status = bladeFlow1.getStatus();
- // System.out.println("status = " + status);
- //
- // // R> listR = flowClient.todoList(processDefinitionKey);
- // // listR.getData().forEach(taskList -> {
- // // System.out.println("任务名称:"+taskList);
- // // System.out.println(taskList.getTaskName());
- // // System.out.println(taskList.getStatus());
- // // });
- //
- // R