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 new file mode 100644 index 0000000..466e9e4 --- /dev/null +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/constant/TicketProcessConstant.java @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000..fc794a7 --- /dev/null +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/ProcessDictFeignService.java @@ -0,0 +1,43 @@ +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 new file mode 100644 index 0000000..1f70c8d --- /dev/null +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/fallback/ProcessDictFeignServiceFallback.java @@ -0,0 +1,43 @@ +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-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/to/process/ProcessWorkFlowResponse.java similarity index 95% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java rename to hzims-biz-common/src/main/java/com/hnac/hzims/common/to/process/ProcessWorkFlowResponse.java index dbb7447..0b13613 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/to/process/ProcessWorkFlowResponse.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.response; +package com.hnac.hzims.common.to.process; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/hzims-service-api/hzims-operational-api/pom.xml b/hzims-service-api/hzims-operational-api/pom.xml index 539360f..89215f6 100644 --- a/hzims-service-api/hzims-operational-api/pom.xml +++ b/hzims-service-api/hzims-operational-api/pom.xml @@ -57,6 +57,18 @@ org.springblade blade-system-api + + + + com.hnac.hzims + hzims-model + 4.0.0-SNAPSHOT + provided + + + com.hnac.hzims + hzims-biz-common + diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java index a2a083f..9cd3385 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java @@ -149,4 +149,46 @@ public class OperMaintenanceTaskEntity extends TenantEntity { @ApiModelProperty(value = "消息推送模板ID") @JsonSerialize(nullsUsing = NullSerializer.class) private Long messageTemplateId; + + + /** + * 流程状态' + */ + @ApiModelProperty("流程状态") + private Integer flowStatus; + + /** + * 流程描述 + */ + @ApiModelProperty("流程描述") + private String flowDescription; + + + + /** + * 下一个审批人 + */ + @ApiModelProperty("下一个审批人") + private String nextStepOperator; + + + /** + * 用户Id + */ + @ApiModelProperty("用户Id") + private String flowUserId; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskName; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskId; } 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 new file mode 100644 index 0000000..725bec4 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.operational.maintenance.feign; + +import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; +import com.hnac.hzims.operational.OperationalConstants; +import com.hnac.hzims.operational.maintenance.feign.fallback.MaintenanceFeignClientFallback; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.stereotype.Repository; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/14 15:12 + */ +@FeignClient( + value = OperationalConstants.APP_NAME, + fallback = MaintenanceFeignClientFallback.class +) +@Repository +public interface MaintenanceFeignClient { + + + @PostMapping("/maintenance/findPending") + @ApiOperation(value = "日常维护待处理") + public Boolean findPending(@RequestBody ProcessWorkFlowResponse response); + +} 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 new file mode 100644 index 0000000..a252c47 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/fallback/MaintenanceFeignClientFallback.java @@ -0,0 +1,19 @@ +package com.hnac.hzims.operational.maintenance.feign.fallback; + +import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; +import com.hnac.hzims.operational.maintenance.feign.MaintenanceFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/14 15:13 + */ +@Component +public class MaintenanceFeignClientFallback implements MaintenanceFeignClient { + @Override + public Boolean findPending(ProcessWorkFlowResponse response) { + throw new IllegalArgumentException("日常维护流程出现异常呢"); + } +} diff --git a/hzims-service-api/ticket-api/pom.xml b/hzims-service-api/ticket-api/pom.xml index 3953799..89ced25 100644 --- a/hzims-service-api/ticket-api/pom.xml +++ b/hzims-service-api/ticket-api/pom.xml @@ -21,5 +21,5 @@ com.hnac.hzims hzims-operational-api - + 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 new file mode 100644 index 0000000..8d424ac --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/OperationTicketFeignClientFallback.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.ticket.ticketprocess.fallback; + +import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/15 11:41 + */ +@Slf4j +@Component +public class OperationTicketFeignClientFallback implements OperationTicketFeignClient { + /** + * 操作票待处理 + * + * @param response + */ + @Override + public Boolean findPending(ProcessWorkFlowResponse response) { + log.error("操作票流程出现异常呢"); + return false; + } +} 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 new file mode 100644 index 0000000..03c672b --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/TicketProcessFeignClientFallback.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.ticket.ticketprocess.fallback; + +import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/15 11:44 + */ +@Slf4j +@Component +public class TicketProcessFeignClientFallback implements TicketProcessFeignClient { + /** + * 工作票待处理 + * + * @param response + */ + @Override + public Boolean findPending(ProcessWorkFlowResponse response) { + log.error("工作票出现异常呢"); + return false; + } +} 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 new file mode 100644 index 0000000..b07f0b0 --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.ticket.ticketprocess.feign; + +import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.constants.TicketConstants; +import com.hnac.hzims.ticket.ticketprocess.fallback.OperationTicketFeignClientFallback; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/15 11:39 + */ +@FeignClient( + value = TicketConstants.APP_NAME, + fallback = OperationTicketFeignClientFallback.class +) +public interface OperationTicketFeignClient { + + + /** + * 操作票待处理 + * @param response + */ + @PostMapping("/operation-ticket/findPending") + @ApiOperation(value = "操作票待处理") + public Boolean findPending(@RequestBody ProcessWorkFlowResponse response); + + + +} 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 new file mode 100644 index 0000000..94ec0c0 --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.ticket.ticketprocess.feign; + +import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.constants.TicketConstants; +import com.hnac.hzims.ticket.ticketprocess.fallback.TicketProcessFeignClientFallback; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/15 11:35 + */ +@FeignClient( + value = TicketConstants.APP_NAME, + fallback = TicketProcessFeignClientFallback.class +) +public interface TicketProcessFeignClient { + + + /** + * 工作票待处理 + * + * @param response + */ + @PostMapping("/ticket-process/findPending") + @ApiOperation(value = "工作票待处理") + public Boolean findPending(@RequestBody ProcessWorkFlowResponse response); + +} diff --git a/hzims-service/hzims-middle/pom.xml b/hzims-service/hzims-middle/pom.xml index 38e1819..14cb245 100644 --- a/hzims-service/hzims-middle/pom.xml +++ b/hzims-service/hzims-middle/pom.xml @@ -66,6 +66,20 @@ swagger-bootstrap-ui ${swagger-bootstrap-ui.version} + + com.hnac.hzims + hzims-operational-api + + + com.hnac.hzims + hzims-model + 4.0.0-SNAPSHOT + compile + + + com.hnac.hzims + ticket-api + diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java similarity index 97% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java index b797501..e7e9f35 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/CodeGenerator.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/CodeGenerator.java @@ -1,4 +1,4 @@ -// package com.hnac.hzims.ticket.processflow; +package com.hnac.hzims.middle.processflow;// package com.hnac.hzims.ticket.processflow; // // import com.baomidou.mybatisplus.generator.AutoGenerator; // import com.baomidou.mybatisplus.generator.InjectionConfig; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/consumer/StandardWorkTicketConsumer.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java similarity index 86% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/consumer/StandardWorkTicketConsumer.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java index 956dc1e..822e0ea 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/consumer/StandardWorkTicketConsumer.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java @@ -1,12 +1,12 @@ -package com.hnac.hzims.ticket.processflow.consumer; +package com.hnac.hzims.middle.processflow.consumer; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; -import com.hnac.hzims.ticket.processflow.entity.WorkflowOperationLog; -import com.hnac.hzims.ticket.processflow.service.WorkflowOperationLogService; -import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; -import com.hnac.hzims.ticket.processflow.strategy.service.ProcessService; -import com.hnac.hzims.ticket.response.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/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessDictController.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessDictController.java similarity index 52% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessDictController.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessDictController.java index f267139..d34c813 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessDictController.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessDictController.java @@ -1,13 +1,18 @@ -package com.hnac.hzims.ticket.processflow.controller; +package com.hnac.hzims.middle.processflow.controller; -import com.hnac.hzims.ticket.processflow.entity.ProcessDict; -import com.hnac.hzims.ticket.processflow.service.ProcessDictService; -import groovy.util.logging.Slf4j; + +import com.hnac.hzims.middle.processflow.entity.ProcessDict; +import com.hnac.hzims.middle.processflow.service.ProcessDictService; +import com.hnac.hzims.middle.processflow.strategy.core.ProcessIdWorker; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.time.LocalDateTime; + /** * @Author WL * @Version v1.0 @@ -25,10 +30,11 @@ public class ProcessDictController { private final ProcessDictService processDictService; + private final ProcessIdWorker processIdWorker; @GetMapping("/test") - public void test(){ + public void test() { // ProcessDict processDict = new ProcessDict(); // processDict.setDictKey("networking"); // processDict.setDictSort(0); @@ -51,4 +57,32 @@ public class ProcessDictController { } + /** + * 获取工作票工作票唯一ID + * + * @param staff + * @param typeInstrument + * @param createTime + * @return + */ + @GetMapping("/getTicketByCode") + public String getTicketByCode(@RequestParam("staff") String staff, + @RequestParam("typeInstrument") String typeInstrument, + @RequestParam("createTime") LocalDateTime createTime) { + return processIdWorker.getTicketByCode(staff, typeInstrument, createTime); + } + + + /** + * 根据工作流key获取工作流value + * + * @param dictKey + * @return + */ + @GetMapping("/selectDictValueByKey") + public String selectDictValueByKey(@RequestParam("dictKey") String dictKey) { + return processDictService.selectDictValueByKey(dictKey); + } + + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java similarity index 88% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java index 8e22483..0ca7ccb 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java @@ -1,17 +1,17 @@ -package com.hnac.hzims.ticket.processflow.controller; +package com.hnac.hzims.middle.processflow.controller; 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.ticket.processflow.entity.ProcessType; -import com.hnac.hzims.ticket.processflow.properties.TicketProperties; -import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties; -import com.hnac.hzims.ticket.processflow.service.ProcessTypeService; -import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; -import com.hnac.hzims.ticket.processflow.strategy.service.ProcessService; -import com.hnac.hzims.ticket.response.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; @@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; - import java.util.List; import java.util.stream.Collectors; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/WorkflowOperationLogController.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/WorkflowOperationLogController.java similarity index 86% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/WorkflowOperationLogController.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/WorkflowOperationLogController.java index 2c37aca..658a90c 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/WorkflowOperationLogController.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/WorkflowOperationLogController.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.controller; +package com.hnac.hzims.middle.processflow.controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessDict.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/ProcessDict.java similarity index 97% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessDict.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/ProcessDict.java index 185fef7..c4906e5 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessDict.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/ProcessDict.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.entity; +package com.hnac.hzims.middle.processflow.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessType.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/ProcessType.java similarity index 96% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessType.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/ProcessType.java index c44d75f..54c8b44 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessType.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/ProcessType.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.entity; +package com.hnac.hzims.middle.processflow.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/WorkflowOperationLog.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/WorkflowOperationLog.java similarity index 88% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/WorkflowOperationLog.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/WorkflowOperationLog.java index a40e262..ebfcf10 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/WorkflowOperationLog.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/WorkflowOperationLog.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.entity; +package com.hnac.hzims.middle.processflow.entity; import com.baomidou.mybatisplus.annotation.*; @@ -60,8 +60,18 @@ public class WorkflowOperationLog implements Serializable { /** * 表单 */ - @TableField("form_data") - private String formData; + @TableField("variables") + private String variables; + + + + /** + * 用户Id + */ + @TableField("variables") + private String userId; + + /** * 创建时间 diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessDictMapper.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/ProcessDictMapper.java similarity index 67% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessDictMapper.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/ProcessDictMapper.java index 2bb86f5..c4e1a77 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessDictMapper.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/ProcessDictMapper.java @@ -1,6 +1,6 @@ -package com.hnac.hzims.ticket.processflow.mapper; +package com.hnac.hzims.middle.processflow.mapper; -import com.hnac.hzims.ticket.processflow.entity.ProcessDict; +import com.hnac.hzims.middle.processflow.entity.ProcessDict; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; /** diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessTypeMapper.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/ProcessTypeMapper.java similarity index 67% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessTypeMapper.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/ProcessTypeMapper.java index 879df7c..174a07d 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessTypeMapper.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/ProcessTypeMapper.java @@ -1,7 +1,7 @@ -package com.hnac.hzims.ticket.processflow.mapper; +package com.hnac.hzims.middle.processflow.mapper; -import com.hnac.hzims.ticket.processflow.entity.ProcessType; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.middle.processflow.entity.ProcessType; /** *

diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/WorkflowOperationLogMapper.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/WorkflowOperationLogMapper.java similarity index 69% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/WorkflowOperationLogMapper.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/WorkflowOperationLogMapper.java index 03ff752..4bed5fa 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/WorkflowOperationLogMapper.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/WorkflowOperationLogMapper.java @@ -1,7 +1,7 @@ -package com.hnac.hzims.ticket.processflow.mapper; +package com.hnac.hzims.middle.processflow.mapper; -import com.hnac.hzims.ticket.processflow.entity.WorkflowOperationLog; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.middle.processflow.entity.WorkflowOperationLog; /** *

diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/properties/TicketProperties.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/properties/TicketProperties.java similarity index 91% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/properties/TicketProperties.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/properties/TicketProperties.java index ea0a088..6b3f75b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/properties/TicketProperties.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/properties/TicketProperties.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.properties; +package com.hnac.hzims.middle.processflow.properties; import lombok.Data; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/properties/WorkTicketProperties.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/properties/WorkTicketProperties.java similarity index 85% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/properties/WorkTicketProperties.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/properties/WorkTicketProperties.java index be2c482..57def39 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/properties/WorkTicketProperties.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/properties/WorkTicketProperties.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.properties; +package com.hnac.hzims.middle.processflow.properties; import lombok.Data; import lombok.Getter; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessDictService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/ProcessDictService.java similarity index 74% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessDictService.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/ProcessDictService.java index 7113a06..0c51818 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessDictService.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/ProcessDictService.java @@ -1,7 +1,7 @@ -package com.hnac.hzims.ticket.processflow.service; +package com.hnac.hzims.middle.processflow.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.hnac.hzims.ticket.processflow.entity.ProcessDict; +import com.hnac.hzims.middle.processflow.entity.ProcessDict; /** * @Author WL diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessTypeService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/ProcessTypeService.java similarity index 67% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessTypeService.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/ProcessTypeService.java index 10c6a6d..5756d74 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessTypeService.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/ProcessTypeService.java @@ -1,7 +1,7 @@ -package com.hnac.hzims.ticket.processflow.service; +package com.hnac.hzims.middle.processflow.service; -import com.hnac.hzims.ticket.processflow.entity.ProcessType; import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.middle.processflow.entity.ProcessType; /** *

diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/WorkflowOperationLogService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/WorkflowOperationLogService.java similarity index 68% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/WorkflowOperationLogService.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/WorkflowOperationLogService.java index c6b054f..e4d62f4 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/WorkflowOperationLogService.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/WorkflowOperationLogService.java @@ -1,7 +1,7 @@ -package com.hnac.hzims.ticket.processflow.service; +package com.hnac.hzims.middle.processflow.service; -import com.hnac.hzims.ticket.processflow.entity.WorkflowOperationLog; import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.middle.processflow.entity.WorkflowOperationLog; /** *

diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessDictServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/ProcessDictServiceImpl.java similarity index 73% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessDictServiceImpl.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/ProcessDictServiceImpl.java index 84fbfd9..590ce0f 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessDictServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/ProcessDictServiceImpl.java @@ -1,12 +1,12 @@ -package com.hnac.hzims.ticket.processflow.service.impl; +package com.hnac.hzims.middle.processflow.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.hnac.hzims.ticket.processflow.entity.ProcessDict; -import com.hnac.hzims.ticket.processflow.mapper.ProcessDictMapper; -import com.hnac.hzims.ticket.processflow.service.ProcessDictService; -import groovy.util.logging.Slf4j; +import com.hnac.hzims.middle.processflow.entity.ProcessDict; +import com.hnac.hzims.middle.processflow.mapper.ProcessDictMapper; +import com.hnac.hzims.middle.processflow.service.ProcessDictService; +import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; @@ -18,7 +18,7 @@ import org.springframework.stereotype.Service; */ @Slf4j @Service -public class ProcessDictServiceImpl extends ServiceImpl implements ProcessDictService { +public class ProcessDictServiceImpl extends ServiceImpl implements ProcessDictService { /** * 根据字典key查询字典value * diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessTypeServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/ProcessTypeServiceImpl.java similarity index 59% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessTypeServiceImpl.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/ProcessTypeServiceImpl.java index c787a91..61e87c4 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessTypeServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/ProcessTypeServiceImpl.java @@ -1,8 +1,8 @@ -package com.hnac.hzims.ticket.processflow.service.impl; +package com.hnac.hzims.middle.processflow.service.impl; -import com.hnac.hzims.ticket.processflow.entity.ProcessType; -import com.hnac.hzims.ticket.processflow.mapper.ProcessTypeMapper; -import com.hnac.hzims.ticket.processflow.service.ProcessTypeService; +import com.hnac.hzims.middle.processflow.entity.ProcessType; +import com.hnac.hzims.middle.processflow.mapper.ProcessTypeMapper; +import com.hnac.hzims.middle.processflow.service.ProcessTypeService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/WorkflowOperationLogServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/WorkflowOperationLogServiceImpl.java similarity index 62% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/WorkflowOperationLogServiceImpl.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/WorkflowOperationLogServiceImpl.java index 26e0e38..0f60290 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/WorkflowOperationLogServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/WorkflowOperationLogServiceImpl.java @@ -1,9 +1,9 @@ -package com.hnac.hzims.ticket.processflow.service.impl; +package com.hnac.hzims.middle.processflow.service.impl; -import com.hnac.hzims.ticket.processflow.entity.WorkflowOperationLog; -import com.hnac.hzims.ticket.processflow.mapper.WorkflowOperationLogMapper; -import com.hnac.hzims.ticket.processflow.service.WorkflowOperationLogService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.middle.processflow.entity.WorkflowOperationLog; +import com.hnac.hzims.middle.processflow.mapper.WorkflowOperationLogMapper; +import com.hnac.hzims.middle.processflow.service.WorkflowOperationLogService; import org.springframework.stereotype.Service; /** diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java similarity index 70% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java index c00872d..5268256 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java @@ -1,8 +1,8 @@ -package com.hnac.hzims.ticket.processflow.strategy.abstracts; +package com.hnac.hzims.middle.processflow.strategy.abstracts; -import com.hnac.hzims.ticket.processflow.entity.ProcessType; -import com.hnac.hzims.ticket.processflow.service.ProcessTypeService; -import com.hnac.hzims.ticket.processflow.strategy.service.ProcessService; +import com.hnac.hzims.middle.processflow.entity.ProcessType; +import com.hnac.hzims.middle.processflow.service.ProcessTypeService; +import com.hnac.hzims.middle.processflow.strategy.service.ProcessService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/core/ProcessIdWorker.java similarity index 99% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/core/ProcessIdWorker.java index 6e1fdf9..061f096 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/core/ProcessIdWorker.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.strategy.core; +package com.hnac.hzims.middle.processflow.strategy.core; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.StringUtils; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/entity/WorkflowQueue.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/entity/WorkflowQueue.java similarity index 82% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/entity/WorkflowQueue.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/entity/WorkflowQueue.java index 1424f63..790f6db 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/entity/WorkflowQueue.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/entity/WorkflowQueue.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.strategy.entity; +package com.hnac.hzims.middle.processflow.strategy.entity; import lombok.Data; import lombok.experimental.Accessors; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/ProcessService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java similarity index 66% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/ProcessService.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java index 6dd725b..432ee87 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/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.ticket.processflow.strategy.service; +package com.hnac.hzims.middle.processflow.strategy.service; -import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; -import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; +import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; +import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; /** * @Author dfy diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java similarity index 60% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java index bbc5cdf..d332bb0 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/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,17 @@ -package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; +package com.hnac.hzims.middle.processflow.strategy.serviceimpl; -import com.hnac.hzims.ticket.processflow.service.ProcessDictService; -import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService; -import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; -import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; -import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; +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.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY; -import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.MACHINERY_TICKET_KEY; +import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.MACHINERY_TICKET_KEY; + /** * 水力机械工作票实现类 @@ -27,7 +28,7 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService { - private final TicketProcessService ticketProcessService; + private final OperationTicketFeignClient ticketProcessService; @@ -64,6 +65,10 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { - ticketProcessService.findPending(response); + Boolean pending = ticketProcessService.findPending(response); + if (!pending) { + throw new ServiceException("水力机械工作票流程出现异常呢"); + + } } } 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 new file mode 100644 index 0000000..acf85bd --- /dev/null +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java @@ -0,0 +1,66 @@ +package com.hnac.hzims.middle.processflow.strategy.serviceimpl; + + +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; + + +/** + * 日常维护实现类 + * + * @Author dfy + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/3/28 8:47 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class MaintenanceProcessServiceImpl extends ProcessAbstractService { + + + private final MaintenanceFeignClient maintenanceFeignClient; + + + private final ProcessDictService processDictService; + + + /** + * 设置执行那种实现类 + * + * @param flowQueue + * @return + */ + @Override + public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { + log.info("是否执日常维护流程环节操作~~~~,流程ticket: {}", flowQueue); + String dictValue = processDictService.selectDictValueByKey(MAINTENANCE_KEY); + if (dictValue.equals(flowQueue.getProcessDefinitionKey())) { + log.info("已执行日常维护流程环节操作~~~~"); + return true; + } + log.error("未是否执行日常维护流程环节操作,请联系管理员~~~~"); + return false; + } + + /** + * 日常维护业务方法 + * + * @param response + */ + @Override + public void calculate(ProcessWorkFlowResponse response) { + Boolean pending = maintenanceFeignClient.findPending(response); + if (!pending) { + throw new ServiceException("日常维护业务流程出错呢"); + } + } +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java similarity index 58% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java index 4b1c653..da0ebae 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java @@ -1,19 +1,21 @@ -package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; - -import com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant; -import com.hnac.hzims.ticket.processflow.service.ProcessDictService; -import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; -import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService; -import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; -import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; +package com.hnac.hzims.middle.processflow.strategy.serviceimpl; + + +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.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY; +import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.FIRST_TICKET_KEY; + /** - * 开工作票流程实现类 + * 工作票流程实现类 * * @Author dfy * @Version v1.0 @@ -27,7 +29,7 @@ public class OneTicketProcessServiceImpl extends ProcessAbstractService { - private final TicketProcessService ticketProcessService; + private final TicketProcessFeignClient ticketProcessService; @@ -64,6 +66,10 @@ public class OneTicketProcessServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { - ticketProcessService.findPending(response); + Boolean pending = ticketProcessService.findPending(response); + if (!pending) { + throw new ServiceException("工作票流程出现异常呢"); + + } } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java similarity index 58% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java rename to hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java index 7590575..5d36191 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java @@ -1,19 +1,20 @@ -package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; +package com.hnac.hzims.middle.processflow.strategy.serviceimpl; -import com.hnac.hzims.ticket.processflow.service.ProcessDictService; -import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService; -import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; -import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; -import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService; -import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; +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.ticket.processflow.constant.TicketProcessConstant.OPERATION_TICKET_KEY; +import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.OPERATION_TICKET_KEY; + /** - * 开工作票流程实现类 + * 操作票流程实现类 * * @Author dfy * @Version v1.0 @@ -27,7 +28,7 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService { - private final OperationTicketService operationTicketService; + private final TicketProcessFeignClient operationTicketService; @@ -35,10 +36,6 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService { - - - - /** * 设置执行那种实现类 * @@ -64,6 +61,10 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { - operationTicketService.findPending(response); + Boolean pending = operationTicketService.findPending(response); + if (!pending) { + throw new ServiceException("操作票流程出现异常呢"); + + } } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java index 4b59b2d..d36294b 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java @@ -115,7 +115,7 @@ public class SysLogController { @PathVariable Long size, StatisticsVo statisticsVo){ Page page1 = new Page(page, size); - List responseVos = sysLogService.statisticsTitleByModuleName(page1, + IPage responseVos = sysLogService.statisticsTitleByModuleName(page1, statisticsVo); return R.data(responseVos); } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.java index 5350d01..98df167 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.java @@ -1,5 +1,6 @@ package com.hnac.hzims.middle.systemlog.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hnac.hzims.middle.systemlog.entity.SysLog; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -35,5 +36,5 @@ public interface SysLogMapper extends BaseMapper { * @param statisticsVo * @return */ - List statisticsTitleByModuleName(Page moduleName, @Param("statisticsVo") StatisticsVo statisticsVo); + IPage statisticsTitleByModuleName(Page moduleName, @Param("statisticsVo") StatisticsVo statisticsVo); } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/SysLogService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/SysLogService.java index c78ab3c..f61b2d8 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/SysLogService.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/SysLogService.java @@ -44,6 +44,6 @@ public interface SysLogService extends IService { * @param statisticsVo * @return */ - List statisticsTitleByModuleName(Page statisticsTitleResponseVoPage, + IPage statisticsTitleByModuleName(Page statisticsTitleResponseVoPage, StatisticsVo statisticsVo); } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java index 037e97c..31b9d93 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java @@ -61,7 +61,8 @@ public class SysLogServiceImpl extends ServiceImpl impleme * @return */ @Override - public List statisticsTitleByModuleName(Page statisticsTitleResponseVoPage, StatisticsVo statisticsVo) { + public IPage statisticsTitleByModuleName(Page statisticsTitleResponseVoPage, StatisticsVo statisticsVo) { + return baseMapper.statisticsTitleByModuleName(statisticsTitleResponseVoPage, statisticsVo); } diff --git a/hzims-service/operational/pom.xml b/hzims-service/operational/pom.xml index e9dd242..e015f6c 100644 --- a/hzims-service/operational/pom.xml +++ b/hzims-service/operational/pom.xml @@ -245,8 +245,6 @@ swagger-bootstrap-ui ${swagger-bootstrap-ui.version} - - 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 new file mode 100644 index 0000000..9e0e69b --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java @@ -0,0 +1,66 @@ +package com.hnac.hzims.operational.maintenance.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +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; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 日常维护控制层 + * + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/14 8:08 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/maintenance") +public class MaintenanceController { + + + private final MaintenanceService maintenanceService; + + + /** + * 日常维护生成任务 + * @param ids + * @return + */ + @PostMapping("/createTask") + @ApiOperationSupport(order = 60) + @ApiOperation(value = "根据计划ID生成任务") + public R generateTask(@ApiParam(value = "计划ID", required = true) @RequestBody List ids) { + maintenanceService.createTask(ids); + return R.success("日常维护生成任务成功"); + } + + + + + /** + * 日常维护待处理 + * @param response + */ + @PostMapping("/findPending") + @ApiOperation(value = "日常维护待处理") + public Boolean findPending(@RequestBody ProcessWorkFlowResponse response){ + try { + maintenanceService.findPending(response); + return true; + } catch (Exception e) { + throw new ServiceException("日常维护待处理:" + e.getMessage()); + } + } + + +} 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 new file mode 100644 index 0000000..1fb0176 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.operational.maintenance.service; + + + +import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse; + +import java.util.List; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/14 8:24 + */ +public interface MaintenanceService { + + /** + * 日常维护生成任务 + * @param ids + */ + + void createTask(List ids); + + + /** + * 日常维护待处理 + * @param response + */ + void findPending(ProcessWorkFlowResponse response); +} 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 new file mode 100644 index 0000000..bf80bbc --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java @@ -0,0 +1,343 @@ +package com.hnac.hzims.operational.maintenance.service.impl; + +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.hnac.hzims.common.utils.DateUtil; +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.entity.config.MessageTemplateEntity; +import com.hnac.hzims.message.fegin.IMessageClient; +import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; +import com.hnac.hzims.operational.duty.service.IImsDutyMainService; +import com.hnac.hzims.operational.maintenance.entity.OperMaintenancePlanEntity; +import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; +import com.hnac.hzims.operational.maintenance.service.IOperMaintenancePlanService; +import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; +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; +import org.apache.commons.lang3.math.NumberUtils; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseEntity; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.*; +import org.springblade.flow.core.feign.IFlowClient; +import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.springblade.core.tool.utils.DateUtil.PATTERN_DATE; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/14 8:24 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class MaintenanceServiceImpl implements MaintenanceService { + + + private final IOperMaintenancePlanService maintenancePlanService; + private final IImsDutyMainService mainService; + private final IOperMaintenanceTaskService taskService; + private final IMessageClient messageClient; + private final List templateService; + private final IFlowClient flowClient; + private final ISysClient sysClient; + + /** + * 日常维护生成任务 + * + * @param ids + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void createTask(List ids) { + //获取日常维护计划 + LambdaQueryWrapper planEntityLambdaQueryWrapper = new LambdaQueryWrapper<>(); + planEntityLambdaQueryWrapper.in(BaseEntity::getId, ids); + List planEntities = maintenancePlanService + .list(planEntityLambdaQueryWrapper); + //筛选当月没生成任务的计划 + List finalPlanEntities = planEntities.stream().filter(planEntity -> + ObjectUtil.isEmpty(planEntity.getCreateTaskTime()) + || !DateUtil.judgeSameDay( + DateUtil.DateToLocalDateTime(planEntity.getCreateTaskTime()), LocalDate.now()) + ).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(finalPlanEntities)) { + throw new ServiceException("所选计划当天已生成任务"); + } + for (OperMaintenancePlanEntity finalPlanEntity : finalPlanEntities) { + // 通过计划生成任务 + this.createTaskByPlan(finalPlanEntity); + //更新任务派发时间 + LambdaUpdateWrapper planEntityLambdaUpdateWrapper = + new LambdaUpdateWrapper<>(); + planEntityLambdaUpdateWrapper.set(OperMaintenancePlanEntity::getCreateTaskTime, new Date()); + planEntityLambdaUpdateWrapper.eq(OperMaintenancePlanEntity::getId, finalPlanEntity.getId()); + boolean update = maintenancePlanService.update(planEntityLambdaUpdateWrapper); + if (!update) { + log.error("maintenance:generateTask 更新任务派发失败"); + throw new ServiceException("更新任务派发失败"); + } + } + } + + /** + * 日常维护待处理 + * + * @param response + */ + @Override + public void findPending(ProcessWorkFlowResponse response) { + log.info("获取businessKey: {}", response.getBusinessKey()); + log.info("获取taskId: {} ", response.getTaskId()); + log.info("获取下一个审批人是: {} ", response.getNextStepOperator()); + log.info("获取下一个用户Id是: {} ", response.getUserId()); + log.info("获取当前任务名称是: {} ", response.getTaskName()); + log.info("获取根据handleType区分是用户还是候选组角色: {}", response.getHandleType()); + //json转换表单 + String formData = JSON.toJSONString(response.getVariables()); + log.info("获取表单的数据:{}", formData); + OperMaintenanceTaskEntityVo standardTicketInfoVo = null; + try { + JSONObject jsonObject = JSONObject.parseObject(formData); + standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, OperMaintenanceTaskEntityVo.class); + } catch (Exception e) { + log.error("获取表单出现异常了~~~~"); + throw new IllegalArgumentException(e.getMessage()); + } + //1.查询日常维护信息 + Long id = NumberUtils.toLong(response.getBusinessKey()); + OperMaintenanceTaskEntity dbOperMaintenanceTaskEntity = taskService.getById(id); + if (ObjectUtils.isEmpty(dbOperMaintenanceTaskEntity)) { + log.error("获取日常维护数据不存在"); + return; + } + OperMaintenanceTaskEntity entity = new OperMaintenanceTaskEntity(); + BeanUtils.copyProperties(standardTicketInfoVo,entity); + entity.setId(id); + //填充日常维护信息 + saveOperMaintenanceTaskEntity(entity, response); + entity.setProcessInstanceId(response.getProcessInstanceId()); + taskService.updateById(entity); + + //推送消息 + 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); + //您有一张工作票待审批,工作内容:*****,审批环节:*****; + 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); + } + } + } + + + /** + * 填充日常维护信息 + * @param entity + * @param response + */ + private void saveOperMaintenanceTaskEntity(OperMaintenanceTaskEntity entity, ProcessWorkFlowResponse response) { + String flowDescription = ""; + //如果response.getHandleType() 是0使用户 + entity.setFlowUserId(response.getUserId()); + entity.setNextStepOperator(response.getNextStepOperator()); + flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批"); + //如果taskId为空 + String taskId = response.getTaskId(); + if (StringUtils.isEmpty(taskId)) { + entity.setFlowDescription("结束"); + entity.setFlowTaskId(" "); + entity.setFlowTaskName("结束"); + entity.setNextStepOperator(" "); + entity.setFlowStatus(999); + } else { + entity.setFlowTaskId(taskId); + entity.setFlowTaskName(response.getTaskName()); + entity.setFlowDescription(flowDescription); + } + } + + + /** + * 通过计划生成任务 + * + * @param finalPlanEntity + */ + private void createTaskByPlan(OperMaintenancePlanEntity finalPlanEntity) { + OperMaintenanceTaskEntity taskEntity = BeanUtil.copy(finalPlanEntity, OperMaintenanceTaskEntity.class); + //拆分设备 每个设备生成一条任务 + if (StringUtil.isNotBlank(finalPlanEntity.getEmCode())) { + log.info("finalPlanEntity.getEmCode() : {}", finalPlanEntity.getEmCode()); + List emCodeList = Arrays.asList(finalPlanEntity.getEmCode().split(",")); + for (String emCode : emCodeList) { + taskEntity.setEmCode(emCode); + this.fillTask(taskEntity, finalPlanEntity); + } + } else { + this.fillTask(taskEntity, finalPlanEntity); + } + + } + + + /** + * 补充日常维护任务内容 + * + * @param taskEntity + * @param finalPlanEntity + */ + private void fillTask(OperMaintenanceTaskEntity taskEntity, OperMaintenancePlanEntity finalPlanEntity) { + taskEntity.setId(null); + taskEntity.setCreateTime(new Date()); + taskEntity.setUpdateTime(new Date()); + taskEntity.setPlanId(finalPlanEntity.getId()); + taskEntity.setTaskCode(UUID.randomUUID().toString()); + if (taskEntity.getRefLibraryId() != 0) { + taskEntity.setCreateTime(org.springblade.core.tool.utils.DateUtil.now()); + } + taskEntity.setDisposer(StringObjUtils.toString(finalPlanEntity.getDisposer())); + //补充计划结束时间 + Instant instant = taskEntity.getDisposeTime().toInstant(); + ZoneId zoneId = ZoneId.systemDefault(); + LocalDateTime disposeTime = instant.atZone(zoneId).toLocalDateTime(); + taskEntity.setPlanEndTime(disposeTime.plusHours(taskEntity.getHours())); + //获取值班人员 + if (ObjectUtil.isNotEmpty(finalPlanEntity.getMaintenanceModel()) && finalPlanEntity.getMaintenanceModel() == 2) { + //查询值班信息 + LambdaQueryWrapper entityLambdaQueryWrapper = new LambdaQueryWrapper<>(); + entityLambdaQueryWrapper.eq(ImsDutyMainEntity::getDutyDate, + DateTimeFormatter.ofPattern(PATTERN_DATE).format(disposeTime)); + entityLambdaQueryWrapper.eq(ImsDutyMainEntity::getClassId, finalPlanEntity.getImsDutyClassId()); + ImsDutyMainEntity entity = mainService.getOne(entityLambdaQueryWrapper); + if (ObjectUtil.isNotEmpty(entity) && StringUtils.isNotEmpty(entity.getDutyPersonIds())) { + String userId = entity.getDutyPersonIds(); + taskEntity.setDisposer(userId.replaceAll("\\^", ",")); + } else { + log.info("计划ID为:{}未查询到排班记录", finalPlanEntity.getId()); + return; + } + } + taskService.save(taskEntity); + //生成工作流实例 + String processInstanceId = this.startProcess(finalPlanEntity.getProcDefId(), taskEntity); + taskEntity.setProcessInstanceId(processInstanceId); + taskService.updateById(taskEntity); + finalPlanEntity.setCreateTaskTime(new Date()); + maintenancePlanService.updateById(finalPlanEntity); + + taskEntity = taskService.getById(taskEntity.getId()); + //推送消息 + this.pushTaskMessage(taskEntity); + + } + + + + /** + * 开启一个流程实例 + * + * @author xiashandong + **/ + private String startProcess(String processDefinitionKey, OperMaintenanceTaskEntity taskEntity) { + OperMaintenanceTaskEntityVo operMaintenanceTaskEntityVo = new OperMaintenanceTaskEntityVo(); + BeanUtils.copyProperties(taskEntity,operMaintenanceTaskEntityVo); + Map params = new HashMap<>(); + params.put("taskId", taskEntity.getId()); + List userIdList = Stream.of(taskEntity.getDisposer().split(",")).collect(Collectors.toList()); + String taskUsers = userIdList.stream().filter(o -> StringUtils.isNotBlank(o)).map(s -> { + return "taskUser_".concat(s); + }).collect(Collectors.joining(",")); + params.put("initUserIds", taskUsers); + params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); + + return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, + String.valueOf(taskEntity.getId()),taskEntity.getTitle(), params) + .getData() + .getProcessInstanceId(); + } + + + + + /** + * 推送日常维护任务消息 + * @return void + * @Param taskEntity 日常维护任务 + **/ + private void pushTaskMessage(OperMaintenanceTaskEntity taskEntity) { + log.info("开始保存{}的日常维护消息推送记录", taskEntity.getDisposer()); + R templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId()); + if (templateR.isSuccess() && ObjectUtil.isNotEmpty(templateR.getData())) { + Func.toLongList(",", taskEntity.getDisposer()).forEach(userId -> { + //推送消息 + ZoneId zoneId = ZoneId.systemDefault(); + PlanMsgRecordDto planMsgRecordDto = new PlanMsgRecordDto(); + planMsgRecordDto.setTemplateId(taskEntity.getMessageTemplateId()); + planMsgRecordDto.setCreateUser(taskEntity.getCreateUser()); + planMsgRecordDto.setPlanTime(LocalDateTime.ofInstant(taskEntity.getDisposeTime().toInstant(), zoneId)); + planMsgRecordDto.setTaskId(taskEntity.getId()); + planMsgRecordDto.setDeptId(taskEntity.getCreateDept()); + planMsgRecordDto.setReceiver(userId); + TemplateService templateService1 = templateService.stream().filter(item -> item.isTemplateStatus(1)).findFirst().orElse(null); + templateService1.execute(planMsgRecordDto); + log.info("推送内容体为:{}", JSON.toJSONString(taskEntity.getDisposer())); + }); + } + } +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/vo/OperMaintenanceTaskEntityVo.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/vo/OperMaintenanceTaskEntityVo.java new file mode 100644 index 0000000..67d23bb --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/vo/OperMaintenanceTaskEntityVo.java @@ -0,0 +1,222 @@ +package com.hnac.hzims.operational.maintenance.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 日常维护对象 + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/13 17:20 + */ +@Data +public class OperMaintenanceTaskEntityVo { + + + private static final long serialVersionUID = 1L; + + + /** + * 主键id + */ + @ApiModelProperty(value = "主键id") + private Long id; + + /** + * 创建人 + */ + private Long createUser; + + /** + * 创建部门 + */ + @ApiModelProperty(value = "创建部门") + private Long createDept; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + @ApiModelProperty(value = "创建时间") + private Date createTime; + + /** + * 更新人 + */ + private Long updateUser; + + /** + * 更新时间 + */ + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + /** + * 状态[1:正常] + */ + @ApiModelProperty(value = "业务状态") + private Integer status; + + + /** + * 设备编码 + */ + @ApiModelProperty(value = "设备编码") + private String emCode; + /** + * 维护类型 01=定期试验 02=定期保养 03=定期操作 04=其他 + */ + @ApiModelProperty(value = "维护类型 01=定期试验 02=定期保养 03=定期操作 04=其他") + private String typeCode; + /** + * 任务编码 + */ + @ApiModelProperty(value = "任务编码,后台自动生成") + private String taskCode; + /** + * 维护项目 + */ + @ApiModelProperty(value = "维护项目") + private Long refLibraryId; + + /** + * 维护标题 + */ + @ApiModelProperty(value = "维护标题") + private String title; + /** + * 工作流实例ID + */ + @ApiModelProperty(value = "工作流实例ID") + private String processInstanceId; + + + /** + * 执行人 + */ + @ApiModelProperty(value = "执行人") + private String disposer; + /** + * 执行日期 + */ + @ApiModelProperty(value = "任务按周期生成计划时间") + private Date disposeTime; + + @ApiModelProperty(value = "执行时间") + private LocalDateTime executeTime; + /** + * 标准工时 + */ + @ApiModelProperty(value = "标准工时") + private Integer hours; + /** + * 实际工时 + */ + @ApiModelProperty(value = "实际工时") + private Integer actHours; + /** + * 维护内容 + */ + @ApiModelProperty(value = "维护内容") + private String content; + /** + * 操作规范 + */ + @ApiModelProperty(value = "操作规范") + private String workStandards; + /** + * 安全警告 + */ + @ApiModelProperty(value = "安全警告") + private String safo; + /** + * 是否异常 0=否 1=是 + */ + @ApiModelProperty(value = "是否异常 0=否 1=是") + private Integer isAnomaly; + /** + * 遗留问题 + */ + @ApiModelProperty(value = "遗留问题") + private String legacy; + /** + * 问题描述 + */ + @ApiModelProperty(value = "问题描述") + private String description; + + @ApiModelProperty(value = "任务类型") + private String taskType; + + @ApiModelProperty(value = "票据ID") + private Long ticketId; + + @ApiModelProperty(value = "延期状态") + private Integer delayStatus; + + @ApiModelProperty(value = "延期时间") + private LocalDateTime delayDate; + + @ApiModelProperty(value = "计划结束时间") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) + private LocalDateTime planEndTime; + + @ApiModelProperty("计划ID") + private Long planId; + + @ApiModelProperty(value = "消息推送模板ID") + private Long messageTemplateId; + + + /** + * 流程状态' + */ + @ApiModelProperty("流程状态") + private Integer flowStatus; + + /** + * 流程描述 + */ + @ApiModelProperty("流程描述") + private String flowDescription; + + + + /** + * 下一个审批人 + */ + @ApiModelProperty("下一个审批人") + private String nextStepOperator; + + + /** + * 用户Id + */ + @ApiModelProperty("用户Id") + private String flowUserId; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskName; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskId; +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/StringObjUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/StringObjUtils.java new file mode 100644 index 0000000..38b683f --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/StringObjUtils.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.operational.util; + +import org.apache.commons.lang3.StringUtils; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/14 9:24 + */ +public class StringObjUtils extends StringUtils { + + /** + * object转Str + * + * @param obj + * @return + */ + public static String toString(Object obj) { + return obj == null ? (String) obj : obj.toString(); + } + +} diff --git a/hzims-service/ticket/pom.xml b/hzims-service/ticket/pom.xml index cf9ac58..9325e7a 100644 --- a/hzims-service/ticket/pom.xml +++ b/hzims-service/ticket/pom.xml @@ -267,7 +267,7 @@ redis.clients jedis - + 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 deleted file mode 100644 index 5a2ee63..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.hnac.hzims.ticket.processflow.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"; -} 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 37bf5c2..8860871 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 @@ -3,8 +3,9 @@ package com.hnac.hzims.ticket.redisConsume; import com.alibaba.fastjson.JSONObject; import com.hnac.hzims.common.config.RedisMessageListener; import com.hnac.hzims.ticket.constants.TicketConstants; -import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; + 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 da8ccc5..b48ff66 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 @@ -3,9 +3,11 @@ package com.hnac.hzims.ticket.standardTicket.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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; +import org.springblade.core.log.exception.ServiceException; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; @@ -41,6 +43,23 @@ public class OperationTicketController { } + /** + * 操作票待处理 + * @param response + */ + @PostMapping("/findPending") + @ApiOperation(value = "操作票待处理") + public Boolean findPending(@RequestBody ProcessWorkFlowResponse response){ + try { + operationTicketService.findPending(response); + return true; + } catch (Exception e) { + throw new ServiceException("操作票待处理:" + e.getMessage()); + } + } + + + /** 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 986749b..572aa6f 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 @@ -1,25 +1,10 @@ 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.ProcessWorkFlowResponse; -import com.hnac.hzims.ticket.standardTicket.service.StandardWorkTicketService; -import com.hnac.hzims.ticket.processflow.properties.TicketProperties; -import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties; -import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; -import com.hnac.hzims.ticket.processflow.strategy.service.ProcessService; -import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; 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.*; - -import java.time.LocalDateTime; -import java.util.List; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 工作票管理 @@ -36,65 +21,6 @@ import java.util.List; @RequestMapping("/standard/wordTicket") public class StandardWorkTicketController { - private final StandardWorkTicketService standardWorkTicketService; - - - @Autowired - private RedisTemplate redisTemplate; - - - @Autowired - private ProcessIdWorker standardTicketIdWorker; - - - @Autowired - List ticketService; - - - @Autowired - private TicketProperties ticketProperties; - - @ApiOperation("测试开票") - @PostMapping("/createTicket") - public R createTicket() { - ProcessWorkFlowResponse workTicketMessageResponse = new ProcessWorkFlowResponse(); - workTicketMessageResponse.setTaskId(IdWorker.get32UUID()); - workTicketMessageResponse.setTaskName("工作流"); - String jsonString = JSON.toJSONString(workTicketMessageResponse); - redisTemplate.convertAndSend("blade:queue:flow", jsonString); - standardWorkTicketService.createTicket(); - redisTemplate.opsForValue().set("1", "2"); - return R.success("成功"); - } - - - @ApiOperation("测试生成唯一编码") - @GetMapping("/idWored") - public R idWored() { - String ticketCode = standardTicketIdWorker.getTicketByCode("aa", "bb", LocalDateTime.now()); - return R.data(ticketCode); - } - - - @ApiOperation("测试") - @GetMapping("/hello/{type}") - public R hello(@PathVariable String type) { - WorkflowQueue ticket = new WorkflowQueue(); - ticket.setProcessDefinitionKey(type); - ProcessService service = ticketService.stream().filter(item -> item.isWorkflowProcess(ticket)) - .findFirst().orElse(null); - service.calculate(new ProcessWorkFlowResponse()); - return R.data("hello"); - } - - - @ApiOperation("测试1") - @GetMapping("/hello1") - public R hello1() { - List workTickets = ticketProperties.getWorkTickets(); - System.out.println("workTickets = " + workTickets); - return R.data(workTickets); - } } 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 3f4dc34..da8d606 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.ticket.response.ProcessWorkFlowResponse; + import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; -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/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index 38811fb..c42e186 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,16 +5,15 @@ 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.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.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.ticket.constants.TicketConstants; -import com.hnac.hzims.ticket.processflow.service.ProcessDictService; -import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; -import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketMeasureEntity; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; @@ -22,11 +21,9 @@ import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketMeasureServic import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService; import com.hnac.hzims.ticket.standardTicket.utils.OperationWordHelper; import com.hnac.hzims.ticket.twoTicket.constant.TicketConstant; -import com.hnac.hzims.ticket.twoTicket.utils.WordHelper; import com.hnac.hzims.ticket.twoTicket.utils.WordMapUtils; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketMeasureVo; -import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import com.hnac.hzims.ticket.utils.PdfUtils; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; @@ -55,7 +52,8 @@ import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.OPERATION_TICKET_KEY; +import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.OPERATION_TICKET_KEY; + /** * @Author WL @@ -76,10 +74,8 @@ public class OperationTicketServiceImpl implements OperationTicketService { private final IStationClient stationClient; - private final ProcessIdWorker processIdWorker; - + private final ProcessDictFeignService processDictFeignService; - private final ProcessDictService processDictService; private final IFlowClient flowClient; @@ -128,7 +124,11 @@ public class OperationTicketServiceImpl implements OperationTicketService { standardTicketInfoVo.setSignage(signage); standardTicketInfoVo.setSignageCode(station.getCode()); //2. 获取编码 - String code = processIdWorker.getTicketByCode(standardTicketInfoVo.getSignage(), this.getTicketWichCode(standardTicketInfoVo.getTicketType()), LocalDateTime.now()); + String code = processDictFeignService.getTicketByCode(standardTicketInfoVo.getSignage(), this.getTicketWichCode(standardTicketInfoVo.getTicketType()), LocalDateTime.now()); + log.info("获取编码: {}", code); + if (StringUtils.isBlank(code)) { + throw new ServiceException("服务器异常,请联系管理员"); + } standardTicketInfoVo.setCode(code); //3. 保存操作对象 this.saveStandardTicketInfo(standardTicketInfoVo); @@ -136,8 +136,12 @@ public class OperationTicketServiceImpl implements OperationTicketService { List standardTicketInfoVos = this.saveStandardTicketMeasure( this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo)); standardTicketInfoVo.setStandardTicketMeasureVos(standardTicketInfoVos); - //6. 查询第一种工作票值 - String dictValue = processDictService.selectDictValueByKey(OPERATION_TICKET_KEY); + //6. 查询第操作票值 + String dictValue = processDictFeignService.selectDictValueByKey(OPERATION_TICKET_KEY); + log.info("查询第操作票值: {}", dictValue); + if (StringUtils.isBlank(dictValue)) { + throw new ServiceException("服务器异常,请联系管理员"); + } // 7.启动流程 this.startProcess(standardTicketInfoVo, dictValue); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java index 52e4553..eb1b45b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java @@ -42,7 +42,7 @@ public class OperationWordHelper { public static String getWorkTicketStatus(Integer status) { String result = null; switch (status) { - case 0: + case 1: result = "电气操作票.docx"; default: result = "电气操作票.docx"; 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 a15519d..9ed5c45 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 @@ -3,24 +3,16 @@ package com.hnac.hzims.ticket.twoTicket.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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 io.swagger.annotations.ApiParam; -import io.swagger.annotations.Tag; 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.flow.core.entity.BladeFlow; -import org.springblade.flow.core.feign.IFlowClient; -import org.springblade.flow.core.vo.ComleteTask; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** * 工作票 @@ -55,6 +47,24 @@ public class TicketProcessController { /** + * 工作票待处理 + * @param response + */ + @PostMapping("/findPending") + @ApiOperation(value = "工作票待处理") + public Boolean findPending(@RequestBody ProcessWorkFlowResponse response){ + try { + ticketProcessService.findPending(response); + return true; + } catch (Exception e) { + throw new ServiceException("工作票待处理:" + e.getMessage()); + } + } + + + + + /** * 预览 */ @GetMapping("/newPreview") 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 c4522ba..9117268 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.ticket.response.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 9dd6c6d..e671ae2 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,7 +7,7 @@ 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.google.common.collect.Lists; +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; @@ -21,9 +21,6 @@ import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.WorkTicketConstants; -import com.hnac.hzims.ticket.processflow.service.ProcessDictService; -import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; -import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.twoTicket.constant.TicketConstant; import com.hnac.hzims.ticket.twoTicket.entity.TicketInfoDanger; import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; @@ -41,6 +38,7 @@ 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; @@ -73,8 +71,8 @@ import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; -import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY; -import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.MACHINERY_TICKET_KEY; +import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.FIRST_TICKET_KEY; +import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.MACHINERY_TICKET_KEY; /** @@ -97,9 +95,6 @@ public class TicketProcessServiceImpl implements TicketProcessService { private final IWorkTicketInfoService workTicketInfoService; - private final ProcessIdWorker processIdWorker; - - private final IFirstWorkTicketService firstWorkTicketService; @@ -147,7 +142,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { private final TicketInfoDangerService ticketInfoDangerService; - private final ProcessDictService processDictService; + private final ProcessDictFeignService processDictFeignService; private final IMessageClient messageClient; @@ -195,8 +190,12 @@ public class TicketProcessServiceImpl implements TicketProcessService { workTicketVo.getWorkTicket().setSignage(station.getSignage()); workTicketVo.getWorkTicket().setSignageCode(station.getCode()); //2. 获取编码 - String code = processIdWorker.getTicketByCode(signage, this.getTicketWichCode(workTicketVo.getWorkTicket().getType()), + String code = processDictFeignService.getTicketByCode(signage, this.getTicketWichCode(workTicketVo.getWorkTicket().getType()), LocalDateTime.now()); + log.info("获取编码: {}", code); + if (StringUtils.isBlank(code)) { + throw new ServiceException("服务器异常,请联系管理员"); + } workTicketVo.getWorkTicket().setCode(code); //3 .保存工作对象 this.saveWorkTicketInfo(workTicketVo.getWorkTicket()); @@ -204,8 +203,12 @@ public class TicketProcessServiceImpl implements TicketProcessService { this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket()); //5. 保存工作任务 this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket()); - //6. 查询第一种工作票值 + //6. 查询第工作票值 String dictValue = getDictValue(workTicketVo); + log.info("查询第工作票值: {}", dictValue); + if (StringUtils.isBlank(dictValue)) { + throw new ServiceException("服务器异常,请联系管理员"); + } //7. 开启动作流 this.dealProcess(dictValue, workTicketVo); //8. 处理任务 @@ -233,7 +236,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { } else if ("8".equals(workTicketVo.getWorkTicket().getType()) && userId.longValue() != principal.longValue()) { key = MACHINERY_TICKET_KEY; } - String dictValue = processDictService.selectDictValueByKey(key); + String dictValue = processDictFeignService.selectDictValueByKey(key); return dictValue; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java index 7f02ef8..9d8cd24 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java @@ -126,6 +126,47 @@ public class StandardTicketInfoVo extends TenantEntity { @ApiModelProperty("编号(原站点ID)") private String signageCode; + /** + * 流程状态' + */ + @ApiModelProperty("流程状态") + private Integer flowStatus; + + /** + * 流程描述 + */ + @ApiModelProperty("流程描述") + private String flowDescription; + + + + /** + * 下一个审批人 + */ + @ApiModelProperty("下一个审批人") + private String nextStepOperator; + + + /** + * 用户Id + */ + @ApiModelProperty("用户Id") + private String flowUserId; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskName; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskId; + @ApiModelProperty("创建人名称") diff --git a/hzims-service/ticket/src/main/resources/template/secondary/工作票安全措施附页.docx b/hzims-service/ticket/src/main/resources/template/secondary/工作票安全措施附页.docx index ed79a2b..a58602b 100644 Binary files a/hzims-service/ticket/src/main/resources/template/secondary/工作票安全措施附页.docx and b/hzims-service/ticket/src/main/resources/template/secondary/工作票安全措施附页.docx differ diff --git a/hzims-service/ticket/src/main/resources/template/secondary/有限空间监测记录单.docx b/hzims-service/ticket/src/main/resources/template/secondary/有限空间监测记录单.docx index 1a68c60..5665ece 100644 Binary files a/hzims-service/ticket/src/main/resources/template/secondary/有限空间监测记录单.docx and b/hzims-service/ticket/src/main/resources/template/secondary/有限空间监测记录单.docx differ diff --git a/hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx b/hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx index 43cab96..85b41ac 100644 Binary files a/hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx and b/hzims-service/ticket/src/main/resources/template/secondary/每日开工和收工时间附页.docx differ diff --git a/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx b/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx index abdde27..931dc45 100644 Binary files a/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx and b/hzims-service/ticket/src/main/resources/template/水力机械工作票模版.docx differ diff --git a/hzims-service/ticket/src/main/resources/template/电气第二种工作票模版.docx b/hzims-service/ticket/src/main/resources/template/电气第二种工作票模版.docx index 702f915..068eca3 100644 Binary files a/hzims-service/ticket/src/main/resources/template/电气第二种工作票模版.docx and b/hzims-service/ticket/src/main/resources/template/电气第二种工作票模版.docx differ