From f0492e50185103c0e87a89d942e61f0422cda442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Tue, 9 May 2023 13:47:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8=E5=99=A8bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/message/fegin/IMessageClient.java | 3 +- .../workTicket/entity/WorkTicketInfoEntity.java | 32 ++ .../abstracts/TemplateAbstractService.java | 13 +- .../serviceimpl/MaintenanceTempleServiceImpl.java | 1 + .../ticket/response/ProcessWorkFlowResponse.java | 2 +- .../controller/TicketProcessController.java | 32 +- .../ticket/twoTicket/entity/WorkTicketFinish.java | 1 + .../constant/TicketProcessConstant.java | 14 + .../flowprocess/service/TicketProcessService.java | 31 ++ .../oneserviceImpl/OneMakeProcessServiceImpl.java | 154 +++++++ .../OnePrincipalProcessServiceImpl.java | 126 ++++++ .../OneReceptionProcessServiceImpl.java | 124 ++++++ .../OneSafetyProcessServiceImpl.java | 127 ++++++ .../oneserviceImpl/OneSignProcessServiceImpl.java | 125 ++++++ .../service/IWorkTicketFinishService.java | 6 + .../twoTicket/service/TicketProcessService.java | 8 + .../service/impl/TicketProcessServiceImpl.java | 495 ++++++++++++++++----- .../service/impl/WorkTicketFinishServiceImpl.java | 17 + .../twoTicket/vo/process/FristWorkTicketVo.java | 31 ++ .../ticket/twoTicket/vo/process/WorkTicketVo.java | 18 +- .../service/IWorkTicketContentService.java | 7 + .../service/IWorkTicketDelayService.java | 8 + .../workTicket/service/IWorkTicketInfoService.java | 11 + .../service/IWorkTicketOperateTimeService.java | 7 + .../service/IWorkTicketPrincipalChangeService.java | 8 + .../service/IWorkTicketSafetyMeasureService.java | 7 + .../service/impl/WorkTicketContentServiceImpl.java | 16 + .../service/impl/WorkTicketDelayServiceImpl.java | 16 + .../service/impl/WorkTicketInfoServiceImpl.java | 174 ++++---- .../impl/WorkTicketOperateTimeServiceImpl.java | 16 + .../impl/WorkTicketPrincipalChangeServiceImpl.java | 16 + .../impl/WorkTicketSafetyMeasureServiceImpl.java | 16 + .../main/resources/file/新工作票.bpmn20.xml | 59 +-- .../新电气第一种工作票模板.xlsx | Bin 0 -> 14706 bytes 34 files changed, 1479 insertions(+), 242 deletions(-) create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/constant/TicketProcessConstant.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/service/TicketProcessService.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneMakeProcessServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OnePrincipalProcessServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneReceptionProcessServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneSafetyProcessServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneSignProcessServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/FristWorkTicketVo.java create mode 100644 hzims-service/ticket/src/main/resources/template/新电气第一种工作票模板.xlsx diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java index 0d5bcb2..40338c2 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java @@ -20,8 +20,7 @@ import javax.annotation.Resource; * @author hx */ @FeignClient( - value = MessageConstants.APP_NAME, - fallback = MessageClientFallback.class + value = MessageConstants.APP_NAME ) public interface IMessageClient { String API_PREFIX = "/feign/message"; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java index fc2293a..b1ddd70 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java @@ -386,8 +386,40 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable { private LocalDateTime confirmDateTime; + /** + * 签发人审核时间 + */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime issuerReviewDateTime; + + /** + * 签发人签发是否通过 + */ + @ApiModelProperty("签发人签发是否通过") + private Boolean signFlag; + + + + /** + * 运行人员是否通过 + */ + @ApiModelProperty("运行人员是否通过") + private Boolean recieveFlag; + + + + + /** + * 工作确认是否通过 (delay 工作票延期 transfe 工作票转移 true 通过 ) + */ + @ApiModelProperty("工作确认是否通过 (delay 工作票延期 transfe 工作票转移 true 通过 )") + private String flag; + + + + + + } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/abstracts/TemplateAbstractService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/abstracts/TemplateAbstractService.java index c275b5e..b058eba 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/abstracts/TemplateAbstractService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/abstracts/TemplateAbstractService.java @@ -5,6 +5,8 @@ import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.safeproduct.template.service.TemplateService; 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.beans.factory.annotation.Autowired; import javax.annotation.Resource; @@ -19,7 +21,7 @@ import javax.annotation.Resource; public abstract class TemplateAbstractService implements TemplateService { @Resource - private IMessageClient messageClient; + private IMessageClient messageClient; /** * 具体业务 @@ -27,7 +29,7 @@ public abstract class TemplateAbstractService implements TemplateService { * @param planMsgRecord */ @Override - public void execute(PlanMsgRecordDto planMsgRecord) { + public void execute(PlanMsgRecordDto planMsgRecord) { //1.具体的业务逻辑 PlanMsgRecordDto list = executeTemplateMessage(planMsgRecord); //2.保存数据 @@ -41,7 +43,10 @@ public abstract class TemplateAbstractService implements TemplateService { */ private void saveData(PlanMsgRecordDto list) { log.info("正在保存推送的数据"); - messageClient.planSendMessage(list); + R planMsgRecordDtoR = messageClient.planSendMessage(list); + if (planMsgRecordDtoR.isSuccess()) { + throw new ServiceException(planMsgRecordDtoR.getMsg()); + } } @@ -50,5 +55,5 @@ public abstract class TemplateAbstractService implements TemplateService { * * @return */ - public abstract PlanMsgRecordDto executeTemplateMessage(PlanMsgRecordDto planMsgRecord); + public abstract PlanMsgRecordDto executeTemplateMessage(PlanMsgRecordDto planMsgRecord); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/serviceimpl/MaintenanceTempleServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/serviceimpl/MaintenanceTempleServiceImpl.java index ca50462..3f7108a 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/serviceimpl/MaintenanceTempleServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/template/serviceimpl/MaintenanceTempleServiceImpl.java @@ -41,6 +41,7 @@ public class MaintenanceTempleServiceImpl extends TemplateAbstractService { // planMsgRecord.setContent(JSON.toJSONString(map)); planMsgRecord.setSmsParam(JSON.toJSONString(map)); planMsgRecord.setResourceCode("aliyun-safeTool-push"); + planMsgRecord.setContent(JSON.toJSONString(map)); return planMsgRecord; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java index f32345e..be96d3c 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java @@ -48,6 +48,6 @@ public class ProcessWorkFlowResponse implements Serializable { /**票据表单**/ - private String variables; + private Object variables; } 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 7d0030b..98c62b2 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java @@ -1,18 +1,24 @@ 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 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.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.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * 工作票 @@ -29,8 +35,10 @@ import org.springframework.web.bind.annotation.RestController; public class TicketProcessController { - @Autowired - private TicketProcessService ticketProcessService; + private final TicketProcessService ticketProcessService; + + + /** @@ -45,5 +53,17 @@ public class TicketProcessController { } + /** + * 预览 + * @param ticketType + * @param ticketId + */ + @GetMapping("/preview") + @ApiOperation(value = "预览") + @ApiOperationSupport(order = 11) + public void preview(@RequestParam @ApiParam("票据类型") String ticketType, @RequestParam @ApiParam("票据ID") Long ticketId) { + ticketProcessService.preview(ticketType,ticketId); + } + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java index e201719..46c86ed 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java @@ -144,3 +144,4 @@ public class WorkTicketFinish implements Serializable { } + diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/constant/TicketProcessConstant.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/constant/TicketProcessConstant.java new file mode 100644 index 0000000..a5955e3 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/constant/TicketProcessConstant.java @@ -0,0 +1,14 @@ +package com.hnac.hzims.ticket.twoTicket.flowprocess.constant; + +/** + * 开票常量类 + * + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/8 10:53 + */ +public class TicketProcessConstant { + + public final static String WORKTICKET = "workTicket"; +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/service/TicketProcessService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/service/TicketProcessService.java new file mode 100644 index 0000000..bdc7e77 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/service/TicketProcessService.java @@ -0,0 +1,31 @@ +package com.hnac.hzims.ticket.twoTicket.flowprocess.service; + +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/5/5 8:21 + */ +public interface TicketProcessService { + + + /** + * 判断状态 + * @param processDefinitionKey + * @param enumByStatus + * @return + */ + Boolean isStatus(String processDefinitionKey, FlowWorkTicketConstants enumByStatus); + + + /** + * 执行业务 + * @param response + * @param workTicketVo + */ + void execute(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo); +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneMakeProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneMakeProcessServiceImpl.java new file mode 100644 index 0000000..be9d804 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneMakeProcessServiceImpl.java @@ -0,0 +1,154 @@ +package com.hnac.hzims.ticket.twoTicket.flowprocess.serviceimpl.oneserviceImpl; + +import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; +import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; +import com.hnac.hzims.operational.feign.IAccessTaskClient; +import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; +import com.hnac.hzims.operational.maintenance.feign.ITaskClient; +import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.ticket.constants.TicketConstants; +import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants; +import com.hnac.hzims.ticket.twoTicket.flowprocess.service.TicketProcessService; +import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; +import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketContentService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketPrincipalChangeService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketSafetyMeasureService; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.utils.Func; +import org.springblade.flow.core.feign.IFlowClient; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; + +import static com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants.START; +import static com.hnac.hzims.ticket.twoTicket.flowprocess.constant.TicketProcessConstant.WORKTICKET; + +/** + * 开票 + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/5/5 8:36 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class OneMakeProcessServiceImpl implements TicketProcessService { + + + + private final IFlowClient flowClient; + + + private final IWorkTicketInfoService workTicketInfoService; + + + private final ProcessIdWorker processIdWorker; + + + private final IFirstWorkTicketService firstWorkTicketService; + + + private final IWorkTicketSafetyMeasureService workTicketSafetyMeasureService; + + + private final IWorkTicketContentService contentService; + + + private final IUserClient userClient; + + + private final IOperAccessTaskClient operAccessTaskClient; + + + private final ITaskClient taskClient; + + + private final IAccessTaskClient accessTaskClient; + + private String newFirstWorkTicketFlowKey = "workTicket"; + + + private final IStationClient stationClient; + + + private final WorkTicketOperateTimeServiceImpl workTicketOperateTimeServiceImpl; + + + private final IWorkTicketFinishService workTicketFinishService; + + private final WorkTicketDelayServiceImpl workTicketDelayService; + + + private final IWorkTicketPrincipalChangeService workTicketPrincipalChangeService; + + /** + * 判断状态 + * @param processDefinitionKey + * @param enumByStatus + * @return + */ + @Override + public Boolean isStatus(String processDefinitionKey, FlowWorkTicketConstants enumByStatus) { + if (WORKTICKET.equals(processDefinitionKey) && START.equals(enumByStatus)){ + log.info("执行开票业务成功,正准备处理开票业务逻辑~~~~"); + return true; + } + log.error("执行开票业务出错~~~"); + return false; + } + + + /** + * 执行业务 + * @param response + * @param workTicketVo + */ + @Override + public void execute(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) { + WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); + workTicket.setProcessInstanceId(response.getProcessInstanceId()); + workTicket.setFlowStatus(FlowWorkTicketConstants.SIGN.getStatus()); + workTicket.setFlowDescription(FlowWorkTicketConstants.SIGN.getDescription()); + //保存工作流实例ID + workTicketInfoService.updateById(workTicket); + //处理来源任务 + this.returnTicket(workTicketVo); + } + + + + /** + * 处理来源任务 + * + * @param workTicketVo + */ + private void returnTicket(WorkTicketVo workTicketVo) { + WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); + if (TicketConstants.TaskTypeEnum.JXRW.getType().equals(workTicket.getTaskType())) { + OperAccessTaskEntity taskEntity = new OperAccessTaskEntity(); + taskEntity.setId(workTicket.getTaskId()); + taskEntity.setTicketId(workTicket.getId()); + operAccessTaskClient.updateById(taskEntity); + } + if (TicketConstants.TaskTypeEnum.RCWH.getType().equals(workTicket.getTaskType())) { + OperMaintenanceTaskDTO dto = new OperMaintenanceTaskDTO(); + dto.setId(workTicket.getTaskId()); + dto.setTicketId(workTicket.getId()); + taskClient.doUpdateTaskById(dto); + } + //消缺流程进行 + if ((TicketConstants.TaskTypeEnum.JXRW.getType().equals(workTicket.getTaskType()) || TicketConstants.TaskTypeEnum.JXJH.getType().equals(workTicket.getTaskType())) && Func.isNotEmpty(workTicket.getTaskId())) { + accessTaskClient.billing(workTicket.getTaskId()); + } + } + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OnePrincipalProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OnePrincipalProcessServiceImpl.java new file mode 100644 index 0000000..3e3aa01 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OnePrincipalProcessServiceImpl.java @@ -0,0 +1,126 @@ +package com.hnac.hzims.ticket.twoTicket.flowprocess.serviceimpl.oneserviceImpl; + +import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; +import com.hnac.hzims.operational.feign.IAccessTaskClient; +import com.hnac.hzims.operational.maintenance.feign.ITaskClient; +import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants; +import com.hnac.hzims.ticket.twoTicket.flowprocess.service.TicketProcessService; +import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; +import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketContentService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketPrincipalChangeService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketSafetyMeasureService; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.flow.core.feign.IFlowClient; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; + +import static com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants.*; +import static com.hnac.hzims.ticket.twoTicket.flowprocess.constant.TicketProcessConstant.WORKTICKET; + +/** + * 工作负责人确认安全措施 + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/5/5 8:36 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class OnePrincipalProcessServiceImpl implements TicketProcessService { + + + + private final IFlowClient flowClient; + + + private final IWorkTicketInfoService workTicketInfoService; + + + private final ProcessIdWorker processIdWorker; + + + private final IFirstWorkTicketService firstWorkTicketService; + + + private final IWorkTicketSafetyMeasureService workTicketSafetyMeasureService; + + + private final IWorkTicketContentService contentService; + + + private final IUserClient userClient; + + + private final IOperAccessTaskClient operAccessTaskClient; + + + private final ITaskClient taskClient; + + + private final IAccessTaskClient accessTaskClient; + + private String newFirstWorkTicketFlowKey = "workTicket"; + + + private final IStationClient stationClient; + + + private final WorkTicketOperateTimeServiceImpl workTicketOperateTimeServiceImpl; + + + private final IWorkTicketFinishService workTicketFinishService; + + private final WorkTicketDelayServiceImpl workTicketDelayService; + + + private final IWorkTicketPrincipalChangeService workTicketPrincipalChangeService; + + /** + * 判断状态 + * @param processDefinitionKey + * @param enumByStatus + * @return + */ + @Override + public Boolean isStatus(String processDefinitionKey, FlowWorkTicketConstants enumByStatus) { + if (WORKTICKET.equals(processDefinitionKey) && PRINCIPAL_CONFIRM_MEASURE.equals(enumByStatus)){ + log.info("执行运行人员布置安全措施业务成功,正准备处理签发人签发业务逻辑~~~~"); + return true; + } + log.error("执行运行人员布置安全措施业务出错~~~"); + return false; + } + + + /** + * 执行业务 + * @param response + * @param workTicketVo + */ + @Override + public void execute(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) { + WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); + //负责人确认时间 + //workTicket.setConfirmDateTime(workTicketVo.getWorkTicket().getConfirmDateTime()); + + workTicket.setFlowStatus(PRINCIPAL_CONFIRM_MEASURE.getStatus()); + workTicket.setFlowDescription(PRINCIPAL_CONFIRM_MEASURE.getDescription()); + //更新状态值 + workTicketInfoService.updateById(workTicket); + } + + + + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneReceptionProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneReceptionProcessServiceImpl.java new file mode 100644 index 0000000..b4d3cbd --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneReceptionProcessServiceImpl.java @@ -0,0 +1,124 @@ +package com.hnac.hzims.ticket.twoTicket.flowprocess.serviceimpl.oneserviceImpl; + +import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; +import com.hnac.hzims.operational.feign.IAccessTaskClient; +import com.hnac.hzims.operational.maintenance.feign.ITaskClient; +import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants; +import com.hnac.hzims.ticket.twoTicket.flowprocess.service.TicketProcessService; +import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; +import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketContentService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketPrincipalChangeService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketSafetyMeasureService; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.flow.core.feign.IFlowClient; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; + +import static com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants.RECEIVE; +import static com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants.START; +import static com.hnac.hzims.ticket.twoTicket.flowprocess.constant.TicketProcessConstant.WORKTICKET; + +/** + * 运功人接收 + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/5/5 8:36 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class OneReceptionProcessServiceImpl implements TicketProcessService { + + + + private final IFlowClient flowClient; + + + private final IWorkTicketInfoService workTicketInfoService; + + + private final ProcessIdWorker processIdWorker; + + + private final IFirstWorkTicketService firstWorkTicketService; + + + private final IWorkTicketSafetyMeasureService workTicketSafetyMeasureService; + + + private final IWorkTicketContentService contentService; + + + private final IUserClient userClient; + + + private final IOperAccessTaskClient operAccessTaskClient; + + + private final ITaskClient taskClient; + + + private final IAccessTaskClient accessTaskClient; + + private String newFirstWorkTicketFlowKey = "workTicket"; + + + private final IStationClient stationClient; + + + private final WorkTicketOperateTimeServiceImpl workTicketOperateTimeServiceImpl; + + + private final IWorkTicketFinishService workTicketFinishService; + + private final WorkTicketDelayServiceImpl workTicketDelayService; + + + private final IWorkTicketPrincipalChangeService workTicketPrincipalChangeService; + + /** + * 判断状态 + * @param processDefinitionKey + * @param enumByStatus + * @return + */ + @Override + public Boolean isStatus(String processDefinitionKey, FlowWorkTicketConstants enumByStatus) { + if (WORKTICKET.equals(processDefinitionKey) && RECEIVE.equals(enumByStatus)){ + log.info("执行签发人签发业务成功,正准备处理签发人签发业务逻辑~~~~"); + return true; + } + log.error("执行签发人签发业务出错~~~"); + return false; + } + + + /** + * 执行业务 + * @param response + * @param workTicketVo + */ + @Override + public void execute(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) { + WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); + workTicket.setFlowStatus(FlowWorkTicketConstants.FIX_UP.getStatus()); + workTicket.setFlowDescription(FlowWorkTicketConstants.FIX_UP.getDescription()); + //更新状态值 + workTicketInfoService.updateById(workTicket); + } + + + + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneSafetyProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneSafetyProcessServiceImpl.java new file mode 100644 index 0000000..e051b33 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneSafetyProcessServiceImpl.java @@ -0,0 +1,127 @@ +package com.hnac.hzims.ticket.twoTicket.flowprocess.serviceimpl.oneserviceImpl; + +import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; +import com.hnac.hzims.operational.feign.IAccessTaskClient; +import com.hnac.hzims.operational.maintenance.feign.ITaskClient; +import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants; +import com.hnac.hzims.ticket.twoTicket.flowprocess.service.TicketProcessService; +import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; +import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketContentService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketPrincipalChangeService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketSafetyMeasureService; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.flow.core.feign.IFlowClient; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; + +import static com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants.FIX_UP; +import static com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants.START; +import static com.hnac.hzims.ticket.twoTicket.flowprocess.constant.TicketProcessConstant.WORKTICKET; + +/** + * 运行人员布置安全措施 + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/5/5 8:36 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class OneSafetyProcessServiceImpl implements TicketProcessService { + + + + private final IFlowClient flowClient; + + + private final IWorkTicketInfoService workTicketInfoService; + + + private final ProcessIdWorker processIdWorker; + + + private final IFirstWorkTicketService firstWorkTicketService; + + + private final IWorkTicketSafetyMeasureService workTicketSafetyMeasureService; + + + private final IWorkTicketContentService contentService; + + + private final IUserClient userClient; + + + private final IOperAccessTaskClient operAccessTaskClient; + + + private final ITaskClient taskClient; + + + private final IAccessTaskClient accessTaskClient; + + private String newFirstWorkTicketFlowKey = "workTicket"; + + + private final IStationClient stationClient; + + + private final WorkTicketOperateTimeServiceImpl workTicketOperateTimeServiceImpl; + + + private final IWorkTicketFinishService workTicketFinishService; + + private final WorkTicketDelayServiceImpl workTicketDelayService; + + + private final IWorkTicketPrincipalChangeService workTicketPrincipalChangeService; + + /** + * 判断状态 + * @param processDefinitionKey + * @param enumByStatus + * @return + */ + @Override + public Boolean isStatus(String processDefinitionKey, FlowWorkTicketConstants enumByStatus) { + if (WORKTICKET.equals(processDefinitionKey) && FIX_UP.equals(enumByStatus)){ + log.info("执行运行人员布置安全措施业务成功,正准备处理签发人签发业务逻辑~~~~"); + return true; + } + log.error("执行运行人员布置安全措施业务出错~~~"); + return false; + } + + + /** + * 执行业务 + * @param response + * @param workTicketVo + */ + @Override + public void execute(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) { + WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); + //值班负责人 + workTicket.setWatchPrincipal(workTicketVo.getWorkTicket().getPrincipal()); + workTicket.setWatchPrincipalEndTime(workTicketVo.getWorkTicket().getWatchPrincipalEndTime()); + workTicket.setFlowStatus(FlowWorkTicketConstants.PRINCIPAL_CONFIRM_MEASURE.getStatus()); + workTicket.setFlowDescription(FlowWorkTicketConstants.PRINCIPAL_CONFIRM_MEASURE.getDescription()); + //更新状态值 + workTicketInfoService.updateById(workTicket); + } + + + + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneSignProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneSignProcessServiceImpl.java new file mode 100644 index 0000000..33f51f1 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/flowprocess/serviceimpl/oneserviceImpl/OneSignProcessServiceImpl.java @@ -0,0 +1,125 @@ +package com.hnac.hzims.ticket.twoTicket.flowprocess.serviceimpl.oneserviceImpl; + +import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; +import com.hnac.hzims.operational.feign.IAccessTaskClient; +import com.hnac.hzims.operational.maintenance.feign.ITaskClient; +import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants; +import com.hnac.hzims.ticket.twoTicket.flowprocess.service.TicketProcessService; +import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; +import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketContentService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketPrincipalChangeService; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketSafetyMeasureService; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl; +import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.flow.core.feign.IFlowClient; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; + +import static com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants.SIGN; +import static com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants.START; +import static com.hnac.hzims.ticket.twoTicket.flowprocess.constant.TicketProcessConstant.WORKTICKET; + +/** + * 签发人签发 + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/5/5 8:36 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class OneSignProcessServiceImpl implements TicketProcessService { + + + + private final IFlowClient flowClient; + + + private final IWorkTicketInfoService workTicketInfoService; + + + private final ProcessIdWorker processIdWorker; + + + private final IFirstWorkTicketService firstWorkTicketService; + + + private final IWorkTicketSafetyMeasureService workTicketSafetyMeasureService; + + + private final IWorkTicketContentService contentService; + + + private final IUserClient userClient; + + + private final IOperAccessTaskClient operAccessTaskClient; + + + private final ITaskClient taskClient; + + + private final IAccessTaskClient accessTaskClient; + + private String newFirstWorkTicketFlowKey = "workTicket"; + + + private final IStationClient stationClient; + + + private final WorkTicketOperateTimeServiceImpl workTicketOperateTimeServiceImpl; + + + private final IWorkTicketFinishService workTicketFinishService; + + private final WorkTicketDelayServiceImpl workTicketDelayService; + + + private final IWorkTicketPrincipalChangeService workTicketPrincipalChangeService; + + /** + * 判断状态 + * @param processDefinitionKey + * @param enumByStatus + * @return + */ + @Override + public Boolean isStatus(String processDefinitionKey, FlowWorkTicketConstants enumByStatus) { + if (WORKTICKET.equals(processDefinitionKey) && SIGN.equals(enumByStatus)){ + log.info("执行签发人签发业务成功,正准备处理签发人签发业务逻辑~~~~"); + return true; + } + log.error("执行签发人签发业务出错~~~"); + return false; + } + + + /** + * 执行业务 + * @param response + * @param workTicketVo + */ + @Override + public void execute(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) { + WorkTicketInfoEntity workTicketInfoEntity = workTicketVo.getWorkTicket(); + //更新状态值 + workTicketInfoEntity.setFlowStatus(FlowWorkTicketConstants.RECEIVE.getStatus()); + workTicketInfoEntity.setFlowDescription(FlowWorkTicketConstants.RECEIVE.getDescription()); + workTicketInfoEntity.setSignerDateTime(workTicketVo.getWorkTicket().getSignerDateTime()); + workTicketInfoService.updateById(workTicketInfoEntity); + } + + + + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IWorkTicketFinishService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IWorkTicketFinishService.java index 43bdf90..130ca02 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IWorkTicketFinishService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/IWorkTicketFinishService.java @@ -13,4 +13,10 @@ import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; */ public interface IWorkTicketFinishService extends IService { + /** + * 工作结束 + * @param ticketId + * @return + */ + WorkTicketFinish selectByTicketId(Long ticketId); } 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 2d0005e..c7554d3 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 @@ -23,4 +23,12 @@ public interface TicketProcessService { * @param response */ void findPending(ProcessWorkFlowResponse response); + + + /** + * 预览 + * @param ticketType + * @param ticketId + */ + void preview(String ticketType, Long ticketId); } 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 31608cf..6f7c9dc 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 @@ -1,9 +1,11 @@ package com.hnac.hzims.ticket.twoTicket.service.impl; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; @@ -21,34 +23,44 @@ import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants; import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService; import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; +import com.hnac.hzims.ticket.twoTicket.vo.process.FristWorkTicketVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; -import com.hnac.hzims.ticket.workTicket.dto.WorkTicketContentDto; -import com.hnac.hzims.ticket.workTicket.dto.WorkTicketSafetyMeasureDto; +import com.hnac.hzims.ticket.utils.ExcelUtil; +import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.workTicket.entity.*; -import com.hnac.hzims.ticket.workTicket.service.IWorkTicketContentService; -import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; -import com.hnac.hzims.ticket.workTicket.service.IWorkTicketPrincipalChangeService; -import com.hnac.hzims.ticket.workTicket.service.IWorkTicketSafetyMeasureService; +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.ticket.workTicket.vo.WorkTicketSafetyMeasureVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Workbook; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.feign.IFlowClient; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletResponse; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.*; import java.util.stream.Collectors; + /** * 开票处理流程实现类 * @@ -109,6 +121,21 @@ public class TicketProcessServiceImpl implements TicketProcessService { private final IWorkTicketPrincipalChangeService workTicketPrincipalChangeService; + private final List processService; + + + private final IWorkTicketOperateTimeService workTicketOperateTimeService; + + + private final IWorkTicketInfoService ticketInfoService; + + + @Value("${hzims.ticket.path.pdf.savePath}") + private String pdfSavePath; + + @Value("${hzims.ticket.path.xlsx.savePath}") + private String xlsSavePath; + /** * 启动开票流程 * @@ -132,27 +159,34 @@ public class TicketProcessServiceImpl implements TicketProcessService { throw new ServiceException("根据条件获取唯一站点暂无数据"); } - log.info("前端查的站点编号 :{}",workTicketVo.getWorkTicket().getSignage()); - log.info("后端查寻的站点编码 :{}",station.getSignage()); + log.info("前端查的站点编号 :{}", workTicketVo.getWorkTicket().getSignage()); + log.info("后端查寻的站点编码 :{}", station.getSignage()); if (!workTicketVo.getWorkTicket().getSignage().equals(station.getSignage())) { - throw new ServiceException("获取唯一站点不一致"); + throw new ServiceException("站点标识-两票编码不能为空"); + } + + //获取站点编号 + String signage = station.getSignage(); + if (StringUtils.isBlank(signage) || signage.length() < 2) { + throw new ServiceException("站点标识-两票编码不能为空"); } - String signage = - station.getSignage().length() == 2 ? - station.getSignage() : station.getSignage().substring(0, 2); + + signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2); workTicketVo.getWorkTicket().setSignage(signage); workTicketVo.getWorkTicket().setSignageCode(station.getCode()); //2. 获取编码 - String code = processIdWorker.getTicketByCode(workTicketVo.getWorkTicket().getSignage(), workTicketVo.getWorkTicket().getType(), workTicketVo.getWorkTicket().getMakeDateTime()); + String code = processIdWorker.getTicketByCode(workTicketVo.getWorkTicket().getSignage(), + workTicketVo.getWorkTicket().getType(), LocalDateTime.now()); workTicketVo.getWorkTicket().setCode(code); - //3 .保存工作对象 + //2 .保存工作对象 this.saveWorkTicketInfo(workTicketVo.getWorkTicket()); - //4. 保存安全措施 + //3. 保存安全措施 + log.info("获取报存安全措施:{}", workTicketVo.getSafetyMeasuresList()); this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket()); - //5. 保存工作任务 + //4. 保存工作任务 this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket()); - //6. 开启动作流 + //5. 开启动作流 this.dealProcess(newFirstWorkTicketFlowKey, workTicketVo); } @@ -163,69 +197,207 @@ public class TicketProcessServiceImpl implements TicketProcessService { */ @Override public void findPending(ProcessWorkFlowResponse response) { + log.info("获取待处理的数据 {}", response); + log.info("获取businessKey: {}", response.getBusinessKey()); + log.info("获取taskId: {}", response.getTaskId()); + log.info("获取下一个审批人是: {}", response.getNextStepOperator()); + if (StringUtils.isNull(response.getTaskId())) { + log.info("工作流结束~~~"); + return; + } //json转换表单 - String formData = response.getVariables(); - WorkTicketVo workTicketVo = JSON.parseObject(formData, WorkTicketVo.class); + String formData = JSON.toJSONString(response.getVariables()); + log.info("获取表单的数据:{}", formData); + FristWorkTicketVo fristWorkFlowResponse = null; + try { + fristWorkFlowResponse = JSONObject.parseObject(formData, FristWorkTicketVo.class); + } catch (Exception e) { + e.printStackTrace(); + } + + if (ObjectUtils.isEmpty(fristWorkFlowResponse)) { + log.error("获取表单的数据解析的数据为null"); + return; + } + //获取表单数据 + WorkTicketVo workTicketVo = fristWorkFlowResponse.getWorkTicketVo(); WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); //2.流程处理 - Integer flowStatus = workTicket.getFlowStatus(); - FlowWorkTicketConstants enumByStatus = FlowWorkTicketConstants.getEnumByStatus(flowStatus); - switch (enumByStatus) { - // case START: - // //开票 - // make(response, workTicketVo); - // break; - case SIGN: - //签发人签发 - //工作票签发人默认执行 - sign(response, workTicketVo); - break; - case RECEIVE: - //运功人接收 - reception(response, workTicketVo); - break; - case FIX_UP: - // 运行人员布置安全措施 - safety(response, workTicketVo); - break; - case PRINCIPAL_CONFIRM_MEASURE: - //工作负责人确认安全措施 - principal(response, workTicketVo); - break; - case LICENCE: - //许可人许可 - license(response, workTicketVo); - break; - case PRINCIPAL_CONFIRM_CONTENT: - //工作负责人确认工作内容执行 - principalConfirmContent(response, workTicketVo); - break; - case PRINCIPAL_CONFIRM_END: - //工作负责人确认工作票结束 - principalConfirmEnd(response, workTicketVo); - break; - case LICENSE_CONFIRM_END: - //许可人确认工作票结束 - licenseConfirmEnd(response, workTicketVo); - break; - case PROCESS_POSTPONE: - //工作票延期 - processPostpone(response, workTicketVo); - break; - case PROCESS_COURSE: - //工作票转移 - processCourse(response,workTicketVo); - break; - case SIGN_CONFIRM_DELAY: - //签发人审核 - signConfirmDelay(response,workTicketVo); - break; + String businessKey = response.getBusinessKey(); + WorkTicketInfoEntity workTicketInfo = firstWorkTicketService.getById(businessKey); + if (ObjectUtils.isEmpty(workTicketInfo) || ObjectUtils.isEmpty(workTicket.getId())) { + log.error("获取工作票的数据为不存在"); + return; + } + //更新工作票 + if (workTicket.getId() == null) { + workTicket.setId(workTicketInfo.getId()); + } + + //工作流ID + if (StringUtils.isEmpty(workTicketInfo.getProcessInstanceId())) { + workTicket.setProcessInstanceId(response.getProcessInstanceId()); } + + workTicketInfoService.updateById(workTicket); + //更新安全措施 + List safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); + if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { + log.info("获取安全措施的数据:{}", safetyMeasuresList); + safetyMeasuresList.forEach(item -> { + if (ObjectUtils.isEmpty(item.getId())) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WorkTicketSafetyMeasureEntity::getTicketId, workTicketInfo.getId()); + workTicketSafetyMeasureService.update(item, queryWrapper); + } else { + workTicketSafetyMeasureService.updateById(item); + } + }); + } + //工作票工作任务组 + List workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList(); + if (CollectionUtils.isNotEmpty(workTicketContentDtoList)) { + log.info("获取工作票工作任务组:{}", workTicketContentDtoList); + workTicketContentDtoList.forEach(item -> { + if (ObjectUtils.isEmpty(item.getId())) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WorkTicketContentEntity::getTicketId, workTicketInfo.getId()); + contentService.update(item, queryWrapper); + } else { + contentService.updateById(item); + } + }); + } + // 工作票延期 + WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay(); + if (ObjectUtils.isNotEmpty(workTicketDelay) && ObjectUtils.isNotEmpty(workTicketDelay.getCreateUser())) { + log.info("获取工作票延期:{}", workTicketDelay); + try { + workTicketDelay.setCreateDept(workTicket.getCreateDept()); + workTicketDelay.setTicketId(workTicketInfo.getId()); + workTicketDelay.setTenantId(workTicketInfo.getTenantId()); + if (ObjectUtils.isEmpty(workTicketDelay.getId())) { + workTicketDelayService.save(workTicketDelay); + } else { + workTicketDelayService.updateById(workTicketDelay); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + + //工作结束 + WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish(); + if (ObjectUtils.isNotEmpty(workTicketFinish) && ObjectUtils.isNotEmpty(workTicketFinish.getPrincipal())) { + log.info("获取工作结束:{}", workTicketFinish); + if (ObjectUtils.isEmpty(workTicketFinish.getId())) { + workTicketDelay.setTicketId(workTicketInfo.getId()); + //workTicketDelay.setInitialTime(LocalDateTime.now()); + workTicketFinishService.save(workTicketFinish); + } else { + workTicketDelay.setInitialTime(LocalDateTime.now()); + workTicketFinishService.updateById(workTicketFinish); + } + } + + //工作开始时间和结束时间 + List workTicketOperateTimeEntities = workTicketVo.getWorkTicketOperateTimeEntities(); + if (CollectionUtils.isNotEmpty(workTicketOperateTimeEntities)) { + log.info("工作开始时间和结束时间:{}", workTicketFinish); + workTicketOperateTimeService.saveBatch(workTicketOperateTimeEntities); + } + + + //工作票负责人变更 + WorkTicketPrincipalChangeEntity workTicketPrincipalChange = workTicketVo.getWorkTicketPrincipalChange(); + if (ObjectUtils.isNotEmpty(workTicketPrincipalChange) && workTicketPrincipalChange.getInitialPrincipal() != null) { + log.info("工作票负责人变更: {}", workTicketPrincipalChange); + //原来的负责人 + User user = UserCache.getUser(workTicketPrincipalChange.getInitialPrincipal()); + //新的负责人 + User newUser = UserCache.getUser(workTicketPrincipalChange.getChangePrincipal()); + workTicketPrincipalChange.setCreateDept(workTicket.getCreateDept()); + workTicketPrincipalChange.setTicketId(workTicketInfo.getId()); + workTicketPrincipalChange.setTenantId(workTicketInfo.getTenantId()); + if (workTicketPrincipalChange.getId() == null) { + workTicketPrincipalChangeService.save(workTicketPrincipalChange); + } else { + workTicketPrincipalChangeService.updateById(workTicketPrincipalChange); + } + log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName()); + workTicket.setPrincipal(workTicketPrincipalChange.getChangePrincipal()); + workTicket.setPrincipalName(newUser.getName()); + //更新工作票 + workTicketInfoService.updateById(workTicket); + } + + + // WorkTicketInfoEntity workTicketInfo = firstWorkTicketService.getById(workTicket.getId()); + // Integer flowStatus = workTicketInfo.getFlowStatus(); + // FlowWorkTicketConstants enumByStatus = FlowWorkTicketConstants.getEnumByStatus(flowStatus); + + // ProcessService dbProcessService = processService.stream().filter(item -> item.isStatus(response.getProcessDefinitionKey(), + // enumByStatus)).findFirst().orElse(null); + // dbProcessService.execute(response,workTicketVo); + // + // switch (enumByStatus) { + // case START: + // //开票 + // make(response, workTicketVo); + // break; + // case SIGN: + // //签发人签发 + // //工作票签发人默认执行 + // sign(response, workTicketVo); + // break; + // case RECEIVE: + // //运功人接收 + // reception(response, workTicketVo); + // break; + // case FIX_UP: + // // 运行人员布置安全措施 + // safety(response, workTicketVo); + // break; + // case PRINCIPAL_CONFIRM_MEASURE: + // //工作负责人确认安全措施 + // principal(response, workTicketVo); + // break; + // case LICENCE: + // //许可人许可 + // license(response, workTicketVo); + // break; + // case PRINCIPAL_CONFIRM_CONTENT: + // //工作负责人确认工作内容执行 + // principalConfirmContent(response, workTicketVo); + // break; + // case PRINCIPAL_CONFIRM_END: + // //工作负责人确认工作票结束 + // principalConfirmEnd(response, workTicketVo); + // break; + // case LICENSE_CONFIRM_END: + // //许可人确认工作票结束 + // licenseConfirmEnd(response, workTicketVo); + // break; + // case PROCESS_POSTPONE: + // //工作票延期 + // processPostpone(response, workTicketVo); + // break; + // case PROCESS_COURSE: + // //工作票转移 + // processCourse(response, workTicketVo); + // break; + // case SIGN_CONFIRM_DELAY: + // //签发人审核 + // signConfirmDelay(response, workTicketVo); + // break; + // } } /** * 签发人审核 + * * @param response * @param workTicketVo */ @@ -236,12 +408,12 @@ public class TicketProcessServiceImpl implements TicketProcessService { workTicketInfoService.updateById(workTicket); - } /** * 工作票转移 + * * @param response * @param workTicketVo */ @@ -341,7 +513,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { * @param workTicketVo */ private void license(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) { - List safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); + List safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); if (CollectionUtils.isEmpty(safetyMeasuresList)) { log.error("没有安全措施数据"); return; @@ -349,7 +521,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { //更新安全措施的状态 List workTicketSafetyMeasureEntities = new ArrayList<>(); - for (WorkTicketSafetyMeasureDto workTicketSafetyMeasureDto : safetyMeasuresList) { + for (WorkTicketSafetyMeasureEntity workTicketSafetyMeasureDto : safetyMeasuresList) { WorkTicketSafetyMeasureEntity workTicketSafetyMeasureEntity = BeanUtil.copyProperties(workTicketSafetyMeasureDto, WorkTicketSafetyMeasureEntity.class); workTicketSafetyMeasureEntities.add(workTicketSafetyMeasureEntity); } @@ -373,8 +545,8 @@ public class TicketProcessServiceImpl implements TicketProcessService { //负责人确认时间 //workTicket.setConfirmDateTime(workTicketVo.getWorkTicket().getConfirmDateTime()); - workTicket.setFlowStatus(FlowWorkTicketConstants.PRINCIPAL_CONFIRM_MEASURE.getStatus()); - workTicket.setFlowDescription(FlowWorkTicketConstants.PRINCIPAL_CONFIRM_MEASURE.getDescription()); + workTicket.setFlowStatus(FlowWorkTicketConstants.LICENCE.getStatus()); + workTicket.setFlowDescription(FlowWorkTicketConstants.LICENCE.getDescription()); //更新状态值 workTicketInfoService.updateById(workTicket); } @@ -391,8 +563,6 @@ public class TicketProcessServiceImpl implements TicketProcessService { //值班负责人 workTicket.setWatchPrincipal(workTicketVo.getWorkTicket().getPrincipal()); workTicket.setWatchPrincipalEndTime(workTicketVo.getWorkTicket().getWatchPrincipalEndTime()); - - workTicket.setFlowStatus(FlowWorkTicketConstants.PRINCIPAL_CONFIRM_MEASURE.getStatus()); workTicket.setFlowDescription(FlowWorkTicketConstants.PRINCIPAL_CONFIRM_MEASURE.getDescription()); //更新状态值 @@ -420,9 +590,9 @@ public class TicketProcessServiceImpl implements TicketProcessService { */ //@Transactional(rollbackFor = Exception.class) public void sign(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) { - WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); + WorkTicketInfoEntity workTicketInfoEntity = workTicketVo.getWorkTicket(); //更新状态值 - WorkTicketInfoEntity workTicketInfoEntity = new WorkTicketInfoEntity(); + workTicketInfoEntity.setStatus(FlowWorkTicketConstants.RECEIVE.getStatus()); workTicketInfoEntity.setFlowStatus(FlowWorkTicketConstants.RECEIVE.getStatus()); workTicketInfoEntity.setFlowDescription(FlowWorkTicketConstants.RECEIVE.getDescription()); workTicketInfoEntity.setSignerDateTime(workTicketVo.getWorkTicket().getSignerDateTime()); @@ -436,10 +606,11 @@ public class TicketProcessServiceImpl implements TicketProcessService { private void make(ProcessWorkFlowResponse response, WorkTicketVo workTicketVo) { WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); workTicket.setProcessInstanceId(response.getProcessInstanceId()); + workTicket.setStatus(FlowWorkTicketConstants.SIGN.getStatus()); + workTicket.setFlowStatus(FlowWorkTicketConstants.SIGN.getStatus()); + workTicket.setFlowDescription(FlowWorkTicketConstants.SIGN.getDescription()); //保存工作流实例ID - workTicketInfoService.update(Wrappers.lambdaUpdate(). - set(WorkTicketInfoEntity::getProcessInstanceId, response.getProcessInstanceId()). - set(WorkTicketInfoEntity::getFlowStatus, FlowWorkTicketConstants.SIGN.getStatus()).set(WorkTicketInfoEntity::getFlowDescription, FlowWorkTicketConstants.SIGN.getDescription()).eq(WorkTicketInfoEntity::getId, workTicket.getId())); + workTicketInfoService.updateById(workTicket); //处理来源任务 this.returnTicket(workTicketVo); } @@ -477,41 +648,31 @@ public class TicketProcessServiceImpl implements TicketProcessService { * @param newFirstWorkTicketFlowKey * @param workTicketVo */ - private void - dealProcess(String newFirstWorkTicketFlowKey, WorkTicketVo workTicketVo) { + private void dealProcess(String newFirstWorkTicketFlowKey, WorkTicketVo workTicketVo) { //若为线下工作票 则无需开启工作流 Integer status = WorkTicketConstants.FirstWorkTicketStatusEnum.SIGN.getStatus(); - if (status.intValue() != workTicketVo.getWorkTicket().getStatus().intValue()) { + if (status.intValue() != workTicketVo.getWorkTicket().getFlowStatus().intValue()) { return; } - log.info("租户Id:{}",AuthUtil.getTenantId()); - log.info("用户部门Id: {}",AuthUtil.getUser().getDeptId()); - log.info("用户Id: {}",AuthUtil.getUserId()); + log.info("租户Id:{}", AuthUtil.getTenantId()); + log.info("用户部门Id: {}", AuthUtil.getUser().getDeptId()); + log.info("用户Id: {}", AuthUtil.getUserId()); //获取签发人角色下的人员 R> listR = userClient.relationUserListByRoleAlias(AuthUtil.getTenantId(), Long.parseLong(AuthUtil.getUser().getDeptId()), TicketConstants.SIGNER_ROLE); if (!listR.isSuccess() || CollectionUtil.isEmpty(listR.getData())) { throw new ServiceException("工作票签发人角色下未查询到相关人员"); } - log.info("获取签发人角色下的人员: {}",listR.getData()); + log.info("获取签发人角色下的人员: {}", listR.getData()); Map params = new HashMap<>(4); - params.put("workTicketVo",workTicketVo); + params.put("workTicketVo", workTicketVo); + //已开启流程 + workTicketVo.setIsState(true); + log.info("获取表单的数据: {}", workTicketVo); R processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(newFirstWorkTicketFlowKey, String.valueOf(workTicketVo.getWorkTicket().getId()), workTicketVo.getWorkTicket().getWorkContent(), params); if (!processInstanceContainNameByKey.isSuccess() && processInstanceContainNameByKey.getData() == null) { throw new ServiceException("启动流程失败..."); } - //获取BladeFlow 数据库 - BladeFlow bladeFlow = processInstanceContainNameByKey.getData(); - log.info("获取工作流新的数据: {}",bladeFlow); - WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); - workTicket.setProcessInstanceId(bladeFlow.getProcessInstanceId()); - workTicket.setFlowStatus(FlowWorkTicketConstants.SIGN.getStatus()); - workTicket.setFlowDescription(FlowWorkTicketConstants.SIGN.getDescription()); - //保存工作流实例ID - firstWorkTicketService.updateById(workTicket); - workTicketVo.setWorkTicket(workTicket); - //处理来源任务 - this.returnTicket(workTicketVo); } @@ -521,15 +682,14 @@ public class TicketProcessServiceImpl implements TicketProcessService { * @param workTicketContentDtoList * @param workTicketInfoEntity */ - private void saveWorkTicketContentDto(List workTicketContentDtoList, WorkTicketInfoEntity workTicketInfoEntity) { + private void saveWorkTicketContentDto(List workTicketContentDtoList, WorkTicketInfoEntity workTicketInfoEntity) { if (CollectionUtils.isEmpty(workTicketContentDtoList)) { return; } List contentEntities = workTicketContentDtoList.stream().map(contentDto -> { - WorkTicketContentEntity contentEntity = BeanUtil.copy(contentDto, WorkTicketContentEntity.class); - contentEntity.setTicketId(workTicketInfoEntity.getId()); - contentEntity.setCreateDept(workTicketInfoEntity.getCreateDept()); - return contentEntity; + contentDto.setTicketId(workTicketInfoEntity.getId()); + contentDto.setCreateDept(workTicketInfoEntity.getCreateDept()); + return contentDto; }).collect(Collectors.toList()); boolean savedBatch = contentService.saveBatch(contentEntities); if (!savedBatch) { @@ -545,16 +705,16 @@ public class TicketProcessServiceImpl implements TicketProcessService { * @param safetyMeasuresList * @param workTicketInfoEntity */ - private void saveSafetyMeasures(List safetyMeasuresList, WorkTicketInfoEntity workTicketInfoEntity) { + private void saveSafetyMeasures(List safetyMeasuresList, WorkTicketInfoEntity workTicketInfoEntity) { if (CollectionUtil.isEmpty(safetyMeasuresList)) { return; } + log.info("获取安全措施的数据:{}", safetyMeasuresList); List measureEntityList = safetyMeasuresList.stream().map(measure -> { - WorkTicketSafetyMeasureEntity measureEntity = BeanUtil.copy(measure, WorkTicketSafetyMeasureEntity.class); - measureEntity.setTicketId(workTicketInfoEntity.getId()); - measureEntity.setCreateDept(workTicketInfoEntity.getCreateDept()); - measureEntity.setCreateUser(workTicketInfoEntity.getCreateUser()); - return measureEntity; + measure.setTicketId(workTicketInfoEntity.getId()); + measure.setCreateDept(workTicketInfoEntity.getCreateDept()); + measure.setCreateUser(workTicketInfoEntity.getCreateUser()); + return measure; }).collect(Collectors.toList()); boolean savedBatch = workTicketSafetyMeasureService.saveBatch(measureEntityList); if (!savedBatch) { @@ -630,4 +790,109 @@ public class TicketProcessServiceImpl implements TicketProcessService { return stringJoiner.toString(); } + + /** + * 预览 + * + * @param ticketType + * @param ticketId + */ + @Override + public void preview(String ticketType, Long ticketId) { + WorkTicketVo workTicketVo = ticketInfoService.selectDetailsById(ticketId); + //将查询的数据转换为map + Map workTicketInfoMap = this.convertMap(workTicketVo); + + String fileName = TicketConstants.WordFileNameEnum.getFileNameByType(ticketType) + PdfUtils.XLSX_SUFFIX; + log.info("工作票模板为:{}", fileName); + TemplateExportParams templateExportParams = new TemplateExportParams("template/" + fileName, true); + Workbook workbook = null; + try { + workbook = ExcelUtil.getWorkbook(templateExportParams, workTicketInfoMap); + } catch (Exception e) { + e.printStackTrace(); + } + //上传xlsx至服务器 + try { + ExcelUtil.upload(workbook, xlsSavePath, workTicketVo.getWorkTicket().getWorkContent() + PdfUtils.XLSX_SUFFIX); + } catch (Exception e) { + e.printStackTrace(); + } + //将xlsx文件转换为pdf并保存 + String pdfFileName = workTicketVo.getWorkTicket().getWorkContent() + PdfUtils.PDF_SUFFIX; + String xlsFileName = workTicketVo.getWorkTicket().getWorkContent() + PdfUtils.XLSX_SUFFIX; + PdfUtils.convertPdf(xlsSavePath, xlsFileName, pdfSavePath, pdfFileName); + String savePath = pdfSavePath + pdfFileName; + // 设置response参数,可以打开下载页面 + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + PdfUtils.readPdf(response, savePath); + } + + + //封装map 转换 excel导出 + private Map convertMap(WorkTicketVo workTicketVo) { + Map result = new HashMap<>(); + WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); + //1. 工作对象 + Map workTicketInfoMap = PdfUtils.objectToMap(workTicket); + result.putAll(workTicketInfoMap); + //2. 安全措施 + List safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); + if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { + Map> measureMap = safetyMeasuresList.stream() + .collect(Collectors.groupingBy(WorkTicketSafetyMeasureEntity::getType)); + Arrays.stream(WorkTicketConstants.WorkTicketMeasureTypeEnum.class.getEnumConstants()).forEach(measureEnum -> { + if (CollectionUtil.isNotEmpty(measureMap.get(measureEnum.getType()))) { + List> mapList = measureMap.get(measureEnum.getType()).stream().map(measureVO -> { + Map map = PdfUtils.objectToMap(measureVO); + map.put("safetyMeasure", ObjectUtil.isNotEmpty(map.get("measure")) ? map.get("measure") : null); + String status = TicketConstants.SafetyMeasureStatusEnum.FINISH.getStatus().equals(measureVO.getStatus()) ? TicketConstants.SafetyMeasureStatusEnum.FINISH.getDescribe() : " "; + map.put("status", status); + return map; + }).collect(Collectors.toList()); + workTicketInfoMap.put(measureEnum.getConvertAttributes(), mapList); + } else { + workTicketInfoMap.put(measureEnum.getConvertAttributes(), new ArrayList>(1)); + } + }); + } + //3. 工作票工作任务组 + List workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList(); + if (CollectionUtils.isNotEmpty(workTicketContentDtoList)) { + result.put("workTicketContentDtoList", workTicketContentDtoList); + } + + //4. 工作票延期 + WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay(); + if (ObjectUtils.isNotEmpty(workTicketDelay)) { + result.putAll(PdfUtils.objectToMap(workTicketDelay)); + } + + //5. 工作结束 + WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish(); + if (ObjectUtils.isNotEmpty(workTicketFinish)) { + result.putAll(PdfUtils.objectToMap(workTicketFinish)); + } + + //5. 工作票负责人变更 + WorkTicketPrincipalChangeEntity workTicketPrincipalChange = workTicketVo.getWorkTicketPrincipalChange(); + if (ObjectUtils.isNotEmpty(workTicketPrincipalChange)) { + result.putAll(PdfUtils.objectToMap(workTicketPrincipalChange)); + } + + return result; + } + + + /** + * 对象转map + */ + private static Map parseObjectMap(T target, Class clas) { + return JSONObject.parseObject(JSONObject.toJSONString(target), Map.class); + } } + + + + diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java index 17c044d..e093a17 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java @@ -1,11 +1,15 @@ package com.hnac.hzims.ticket.twoTicket.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.twoTicket.mapper.WorkTicketFinishMapper; import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 工作结束 服务实现类 @@ -17,4 +21,17 @@ import org.springframework.stereotype.Service; @Service public class WorkTicketFinishServiceImpl extends ServiceImpl implements IWorkTicketFinishService { + + /** + * 工作结束 + * + * @param ticketId + * @return + */ + @Override + public WorkTicketFinish selectByTicketId(Long ticketId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WorkTicketFinish::getTicketId,ticketId); + return this.getOne(queryWrapper); + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/FristWorkTicketVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/FristWorkTicketVo.java new file mode 100644 index 0000000..25a44f3 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/FristWorkTicketVo.java @@ -0,0 +1,31 @@ +package com.hnac.hzims.ticket.twoTicket.vo.process; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/5/4 15:17 + */ +@Data +public class FristWorkTicketVo implements Serializable { + + /** + * 签发人签发是否同意 + */ + private boolean signFlag; + + private String flag; + + private boolean pass; + + + /** + * 工作表单 + */ + private WorkTicketVo workTicketVo; + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java index 904541b..378d8ad 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java @@ -1,13 +1,7 @@ package com.hnac.hzims.ticket.twoTicket.vo.process; import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; -import com.hnac.hzims.ticket.workTicket.dto.WorkTicketContentDto; -import com.hnac.hzims.ticket.workTicket.dto.WorkTicketSafetyMeasureDto; -import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; -import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; -import com.hnac.hzims.ticket.workTicket.entity.WorkTicketOperateTimeEntity; -import com.hnac.hzims.ticket.workTicket.entity.WorkTicketPrincipalChangeEntity; -import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketPrincipalChangeServiceImpl; +import com.hnac.hzims.ticket.workTicket.entity.*; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -36,14 +30,15 @@ public class WorkTicketVo { * 安全措施 */ @ApiModelProperty("安全措施数组") - private List safetyMeasuresList; + private List safetyMeasuresList; /** * 工作票工作任务组 + * */ @ApiModelProperty("工作票工作任务组") - private List workTicketContentDtoList; + private List workTicketContentDtoList; /** @@ -73,5 +68,10 @@ public class WorkTicketVo { private WorkTicketPrincipalChangeEntity workTicketPrincipalChange; + /** + * 开启流程 + */ + private Boolean isState = true; + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketContentService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketContentService.java index 6a75ff3..61f3cb8 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketContentService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketContentService.java @@ -15,4 +15,11 @@ public interface IWorkTicketContentService extends BaseService list(WorkTicketContentEntity req); + + /** + * 获取工作票工作任务组 + * @param ticketId + * @return + */ + List selectByTicketId(Long ticketId); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketDelayService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketDelayService.java index 5d2368d..8f2c35f 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketDelayService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketDelayService.java @@ -1,6 +1,7 @@ package com.hnac.hzims.ticket.workTicket.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketDelayDto; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; @@ -54,4 +55,11 @@ public interface IWorkTicketDelayService extends BaseService list(WorkTicketOperateTimeDto req); + + /** + * 工作开始时间和结束时间 + * @param ticketId + * @return + */ + List selectByTicketId(Long ticketId); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketPrincipalChangeService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketPrincipalChangeService.java index 1f60935..ca095d3 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketPrincipalChangeService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketPrincipalChangeService.java @@ -42,4 +42,12 @@ public interface IWorkTicketPrincipalChangeService extends BaseService measureList); + + /** + * 根据工作票编号对应安全措施数组 + * @param ticketId + * @return + */ + List selectByTicketId(Long ticketId); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketContentServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketContentServiceImpl.java index c5b26cd..1b9bd2f 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketContentServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketContentServiceImpl.java @@ -1,7 +1,9 @@ package com.hnac.hzims.ticket.workTicket.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketContentEntity; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketSafetyMeasureEntity; import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketContentMapper; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketContentService; import lombok.extern.slf4j.Slf4j; @@ -21,4 +23,18 @@ public class WorkTicketContentServiceImpl extends BaseServiceImpl list(WorkTicketContentEntity req) { return this.list(Condition.getQueryWrapper(new WorkTicketContentEntity(),req)); } + + /** + * 获取工作票工作任务组 + * + * @param ticketId + * @return + */ + @Override + public List selectByTicketId(Long ticketId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WorkTicketContentEntity::getTicketId,ticketId); + List entities = this.list(queryWrapper); + return entities; + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketDelayServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketDelayServiceImpl.java index a8e5d28..bef4832 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketDelayServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketDelayServiceImpl.java @@ -9,8 +9,10 @@ import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO; import com.hnac.hzims.operational.maintenance.dto.TaskFlowDTO; import com.hnac.hzims.operational.maintenance.feign.ITaskClient; import com.hnac.hzims.ticket.constants.TicketConstants; +import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketDelayDto; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketContentEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketDelayMapper; import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketInfoMapper; @@ -110,6 +112,20 @@ public class WorkTicketDelayServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WorkTicketDelayEntity::getTicketId,ticketId); + List entities = this.list(queryWrapper); + return entities.get(0); + } + + /** * 更新任务延期时间状态 * @param infoDto */ diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index 7bbe64b..40ace2c 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; @@ -22,12 +24,13 @@ import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; import com.hnac.hzims.ticket.aspect.AroundFlow; import com.hnac.hzims.ticket.constants.TicketConstants; +import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants; +import com.hnac.hzims.ticket.twoTicket.service.impl.WorkTicketFinishServiceImpl; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import com.hnac.hzims.ticket.utils.ExcelUtil; import com.hnac.hzims.ticket.workTicket.dto.*; -import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; -import com.hnac.hzims.ticket.workTicket.entity.WorkTicketFlowEntity; -import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.entity.*; import com.hnac.hzims.ticket.workTicket.mapper.WorkDelayNoScopeMapper; import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketInfoMapper; import com.hnac.hzims.ticket.workTicket.service.*; @@ -98,6 +101,8 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpllambdaUpdate() - .set(WorkTicketInfoEntity::getProcessInstanceId, bladeFlow.getProcessInstanceId()) - .eq(WorkTicketInfoEntity::getId, req.getId())); + this.update(Wrappers.lambdaUpdate().set(WorkTicketInfoEntity::getProcessInstanceId, bladeFlow.getProcessInstanceId()).eq(WorkTicketInfoEntity::getId, req.getId())); //将票据ID会传至计划/任务内 returnTicket(req); return R.success("保存成功"); @@ -158,22 +161,10 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpllambdaQuery() - .eq(WorkTicketFlowEntity::getTicketId, ticketId) - .eq(WorkTicketFlowEntity::getFlowCode, TicketConstants.FirstWorkTicketFlowStatusEnum.CONFIRM_WORK_FINISH.getStatus()) - .orderByDesc(WorkTicketFlowEntity::getCreateTime) - .last("limit 1;") - ); - workTicketFlowService.update(Wrappers.lambdaUpdate() - .set(WorkTicketFlowEntity::getExecutor, AuthUtil.getUserId().toString()) - .set(WorkTicketFlowEntity::getExecuteTime, LocalDateTime.now()) - .eq(WorkTicketFlowEntity::getId, workTicketFlowEntity.getId()) - ); + WorkTicketFlowEntity workTicketFlowEntity = workTicketFlowService.getOne(Wrappers.lambdaQuery().eq(WorkTicketFlowEntity::getTicketId, ticketId).eq(WorkTicketFlowEntity::getFlowCode, TicketConstants.FirstWorkTicketFlowStatusEnum.CONFIRM_WORK_FINISH.getStatus()).orderByDesc(WorkTicketFlowEntity::getCreateTime).last("limit 1;")); + workTicketFlowService.update(Wrappers.lambdaUpdate().set(WorkTicketFlowEntity::getExecutor, AuthUtil.getUserId().toString()).set(WorkTicketFlowEntity::getExecuteTime, LocalDateTime.now()).eq(WorkTicketFlowEntity::getId, workTicketFlowEntity.getId())); //更新工作票状态 - this.update(Wrappers.lambdaUpdate() - .set(WorkTicketInfoEntity::getStatus, status) - .eq(WorkTicketInfoEntity::getId, ticketId) - ); + this.update(Wrappers.lambdaUpdate().set(WorkTicketInfoEntity::getStatus, status).eq(WorkTicketInfoEntity::getId, ticketId)); //创建延期流程 WorkTicketInfoEntity infoEntity = this.getById(ticketId); WorkTicketFlowEntity currentFlowEntity = new WorkTicketFlowEntity(); @@ -266,9 +257,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpllambdaUpdate() - .set(WorkTicketInfoEntity::getStatus, TicketConstants.FirstWorkTicketFlowStatusEnum.TERMINATION.getStatus()) - .eq(WorkTicketInfoEntity::getId, id)); + boolean flag = this.update(Wrappers.lambdaUpdate().set(WorkTicketInfoEntity::getStatus, TicketConstants.FirstWorkTicketFlowStatusEnum.TERMINATION.getStatus()).eq(WorkTicketInfoEntity::getId, id)); /**线下单独删除**/ if (TicketConstants.FirstWorkTicketFlowStatusEnum.OFFLINE.getStatus().equals(entity.getStatus())) { @@ -305,8 +294,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl> measureMap = workTicketInfoVO.getWorkTicketSafetyMeasureVOList().stream() - .collect(Collectors.groupingBy(WorkTicketSafetyMeasureVO::getType)); + Map> measureMap = workTicketInfoVO.getWorkTicketSafetyMeasureVOList().stream().collect(Collectors.groupingBy(WorkTicketSafetyMeasureVO::getType)); if (ObjectUtil.isNotEmpty(measureMap.get(TicketConstants.MEASURE_TYPE_ONE))) { workTicketInfoMap.put("matterLibraryListOne", measureMap.get(TicketConstants.MEASURE_TYPE_ONE).stream().map(measure -> { Map map = PdfUtils.objectToMap(measure); @@ -346,8 +334,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl workTicketFlowVOList = workTicketInfoVO.getWorkTicketFlowVOList(); //签发 - List signFlow = workTicketFlowVOList.stream() - .filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.LICENSE.getStatus().equals(Integer.parseInt(f.getFlowCode()))).collect(Collectors.toList()); + List signFlow = workTicketFlowVOList.stream().filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.LICENSE.getStatus().equals(Integer.parseInt(f.getFlowCode()))).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(signFlow)) { workTicketInfoMap.put("signer", signFlow.get(0).getCreateUserName()); workTicketInfoMap.put("signTime", DateUtil.format(signFlow.get(0).getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)); @@ -365,8 +352,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl receiveFlow = workTicketFlowVOList.stream() - .filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.CONFIRM_MEASURE_PRINCIPAL.getStatus().equals(Integer.parseInt(f.getFlowCode()))).collect(Collectors.toList()); + List receiveFlow = workTicketFlowVOList.stream().filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.CONFIRM_MEASURE_PRINCIPAL.getStatus().equals(Integer.parseInt(f.getFlowCode()))).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(receiveFlow)) { workTicketInfoMap.put("receivePrincipal", receiveFlow.get(0).getCreateUserName()); workTicketInfoMap.put("receiveTime", DateUtil.format(receiveFlow.get(0).getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)); @@ -377,8 +363,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl confirmFlow = workTicketFlowVOList.stream() - .filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.CONFIRM_MEASURE_MEMBERS.getStatus().equals(Integer.parseInt(f.getFlowCode()))).collect(Collectors.toList()); + List confirmFlow = workTicketFlowVOList.stream().filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.CONFIRM_MEASURE_MEMBERS.getStatus().equals(Integer.parseInt(f.getFlowCode()))).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(confirmFlow)) { workTicketInfoMap.put("confirmPrincipal", confirmFlow.get(0).getCreateUserName()); workTicketInfoMap.put("confirmTime", DateUtil.format(confirmFlow.get(0).getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)); @@ -387,8 +372,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl finishFlow = workTicketFlowVOList.stream() - .filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.END.getStatus().equals(Integer.parseInt(f.getFlowCode()))).collect(Collectors.toList()); + List finishFlow = workTicketFlowVOList.stream().filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.END.getStatus().equals(Integer.parseInt(f.getFlowCode()))).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(finishFlow)) { workTicketInfoMap.put("finisher", finishFlow.get(0).getCreateUserName()); workTicketInfoMap.put("finishTime", DateUtil.format(finishFlow.get(0).getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)); @@ -399,8 +383,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl endFlow = workTicketFlowVOList.stream() - .filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.FINISH.getStatus().intValue() == Integer.parseInt(f.getFlowCode())).collect(Collectors.toList()); + List endFlow = workTicketFlowVOList.stream().filter(f -> TicketConstants.FirstWorkTicketFlowStatusEnum.FINISH.getStatus().intValue() == Integer.parseInt(f.getFlowCode())).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(endFlow)) { workTicketInfoMap.put("endLicensor", endFlow.get(0).getCreateUserName()); workTicketInfoMap.put("endTime", DateUtil.format(endFlow.get(0).getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)); @@ -431,8 +414,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl membersChangeList = workTicketInfoVO.getWorkTicketMembersChangeVOList(); if (CollectionUtil.isNotEmpty(membersChangeList)) { /**工作成员变更详情**/ - String membersChangeSituation = membersChangeList.stream().map(mc -> - DateUtil.format(mc.getCreateTime(), TicketConstants.TICKET_DATE_PATTERN).concat(":").concat(mc.getChangeMembersName())).collect(Collectors.joining(";")); + String membersChangeSituation = membersChangeList.stream().map(mc -> DateUtil.format(mc.getCreateTime(), TicketConstants.TICKET_DATE_PATTERN).concat(":").concat(mc.getChangeMembersName())).collect(Collectors.joining(";")); workTicketInfoMap.put("membersChangeSituation", membersChangeSituation); workTicketInfoMap.put("memberChangePrincipal", membersChangeList.get(0).getCreateUserName()); } else { @@ -539,13 +521,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpllambdaUpdate() - .set(WorkTicketInfoEntity::getStatus, req.getStatus()) - .set(WorkTicketInfoEntity::getPrincipal, req.getPrincipal()) - .set(WorkTicketInfoEntity::getLicensor, req.getLicensor()) - .set(WorkTicketInfoEntity::getLicenseTime, req.getLicenseTime()) - .set(WorkTicketInfoEntity::getLicenseEndTime, req.getLicenseEndTime()) - .eq(WorkTicketInfoEntity::getId, req.getId())); + boolean flag = this.update(Wrappers.lambdaUpdate().set(WorkTicketInfoEntity::getStatus, req.getStatus()).set(WorkTicketInfoEntity::getPrincipal, req.getPrincipal()).set(WorkTicketInfoEntity::getLicensor, req.getLicensor()).set(WorkTicketInfoEntity::getLicenseTime, req.getLicenseTime()).set(WorkTicketInfoEntity::getLicenseEndTime, req.getLicenseEndTime()).eq(WorkTicketInfoEntity::getId, req.getId())); //新增流程信息 WorkTicketFlowEntity workTicketFlowEntity = new WorkTicketFlowEntity(); @@ -732,13 +708,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpllambdaUpdate() - .set(WorkTicketInfoEntity::getStatus, TicketConstants.FirstWorkTicketFlowStatusEnum.OFFLINE_LICENSE.getStatus()) - .set(WorkTicketInfoEntity::getLicensor, AuthUtil.getUserId()) - .set(WorkTicketInfoEntity::getLicenseTime, LocalDateTime.now()) - .set(WorkTicketInfoEntity::getLicenseEndTime, req.getLicenseEndTime()) - .eq(WorkTicketInfoEntity::getId, ticketId) - ); + update(Wrappers.lambdaUpdate().set(WorkTicketInfoEntity::getStatus, TicketConstants.FirstWorkTicketFlowStatusEnum.OFFLINE_LICENSE.getStatus()).set(WorkTicketInfoEntity::getLicensor, AuthUtil.getUserId()).set(WorkTicketInfoEntity::getLicenseTime, LocalDateTime.now()).set(WorkTicketInfoEntity::getLicenseEndTime, req.getLicenseEndTime()).eq(WorkTicketInfoEntity::getId, ticketId)); return R.success("操作成功"); } @@ -752,10 +722,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpllambdaUpdate() - .set(WorkTicketInfoEntity::getStatus, TicketConstants.FirstWorkTicketFlowStatusEnum.OFFLINE_END.getStatus()) - .eq(WorkTicketInfoEntity::getId, infoDto.getId()) - ); + update(Wrappers.lambdaUpdate().set(WorkTicketInfoEntity::getStatus, TicketConstants.FirstWorkTicketFlowStatusEnum.OFFLINE_END.getStatus()).eq(WorkTicketInfoEntity::getId, infoDto.getId())); //获取工作票实体类 WorkTicketInfoEntity infoEntity = getById(infoDto.getId()); //根据任务类型执行任务 @@ -876,45 +843,38 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl workTicketListByMonthAndArea(Page pageEntity, - StandardTicketWithAreaVo areaVo) { + public BladePage workTicketListByMonthAndArea(Page pageEntity, StandardTicketWithAreaVo areaVo) { //1.查询 QueryWrapper queryWrapper = new QueryWrapper<>(); //开票来源 - queryWrapper.eq(Func.isNotEmpty(areaVo.getTaskType()), "sti.task_type", - areaVo.getTaskType()); + queryWrapper.eq(Func.isNotEmpty(areaVo.getTaskType()), "sti.task_type", areaVo.getTaskType()); //编号 queryWrapper.like(Func.isNotEmpty(areaVo.getCode()), "sti.code", areaVo.getCode()); //状态 - queryWrapper.eq(Func.isNotEmpty(areaVo.getStatus()), "sti.status", - areaVo.getStatus()); + queryWrapper.eq(Func.isNotEmpty(areaVo.getStatus()), "sti.status", areaVo.getStatus()); //开始时间 - queryWrapper.lt(Func.isNotEmpty(areaVo.getStartTime()), "sti.create_time", - areaVo.getStartTime()); + queryWrapper.lt(Func.isNotEmpty(areaVo.getStartTime()), "sti.create_time", areaVo.getStartTime()); //结束时间 - queryWrapper.le(Func.isNotEmpty(areaVo.getEndTime()), "sti.create_time", - areaVo.getEndTime()); + queryWrapper.le(Func.isNotEmpty(areaVo.getEndTime()), "sti.create_time", areaVo.getEndTime()); queryWrapper.eq("sti.create_dept", areaVo.getAreaId()); - queryWrapper.eq(areaVo.getYearMonth() != null, "date_format(sti.create_time,'%Y-%m')", - areaVo.getYearMonth()); + queryWrapper.eq(areaVo.getYearMonth() != null, "date_format(sti.create_time,'%Y-%m')", areaVo.getYearMonth()); //如果为1为合格 // queryWrapper.eq("tie.status",1); Page workTicketInfoEntityPage = baseMapper.selectPages(pageEntity, queryWrapper); //数据转换 List standardWorkList = new ArrayList<>(); if (CollectionUtil.isNotEmpty(workTicketInfoEntityPage.getRecords())) { - standardWorkList = workTicketInfoEntityPage.getRecords() - .stream().map(workTicketInfoEntity -> { - StandardWorkVo standardWorkVo = new StandardWorkVo(); - BeanUtils.copyProperties(workTicketInfoEntity, standardWorkVo); - return standardWorkVo; - }).collect(Collectors.toList()); + standardWorkList = workTicketInfoEntityPage.getRecords().stream().map(workTicketInfoEntity -> { + StandardWorkVo standardWorkVo = new StandardWorkVo(); + BeanUtils.copyProperties(workTicketInfoEntity, standardWorkVo); + return standardWorkVo; + }).collect(Collectors.toList()); } IPage page = new Page<>(); @@ -936,8 +896,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl ticketInfoEvaluateEntityLambdaQueryWrapper = new LambdaQueryWrapper<>(); ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getTicketId, item.getId()); - ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getStatus, - TicketConstants.TicketQualifiedEnum.Qualified.getCode()); + ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getStatus, TicketConstants.TicketQualifiedEnum.Qualified.getCode()); // 查询合格评价 int count = ticketInfoEvaluateService.count(ticketInfoEvaluateEntityLambdaQueryWrapper); return count > 0; @@ -956,6 +915,67 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl queryWrapper = new LambdaUpdateWrapper<>(); queryWrapper.set(WorkTicketInfoEntity::getFlowStatus, status); queryWrapper.set(WorkTicketInfoEntity::getFlowDescription, description); - queryWrapper.eq(WorkTicketInfoEntity::getId,id); + queryWrapper.eq(WorkTicketInfoEntity::getId, id); + } + + /** + * 获取工作详情 + * + * @param ticketId + * @return + */ + @Override + public WorkTicketVo selectDetailsById(Long ticketId) { + WorkTicketVo workTicketVo = new WorkTicketVo(); + + //1. 获取工作票详情数据 + WorkTicketInfoEntity workTicketInfo = this.getById(ticketId); + if (ObjectUtils.isEmpty(workTicketInfo)) { + throw new ServiceException("未查询到ticketId对应的信息"); + } + workTicketVo.setWorkTicket(workTicketInfo); + + //2. 安全措施数组 + List workTicketSafetyMeasureEntity = workTicketSafetyMeasureService.selectByTicketId(ticketId); + if (CollectionUtils.isNotEmpty(workTicketSafetyMeasureEntity)) { + workTicketVo.setSafetyMeasuresList(workTicketSafetyMeasureEntity); + } + + //3. 工作票工作任务组 + List workTicketContentEntities = workTicketContentService.selectByTicketId(ticketId); + if (CollectionUtils.isNotEmpty(workTicketContentEntities)) { + workTicketVo.setWorkTicketContentDtoList(workTicketContentEntities); + } + + //4. 工作票延期 + WorkTicketDelayEntity workTicketDelayEntity = delayService.selectByTicketId(ticketId); + if (ObjectUtils.isNotEmpty(workTicketDelayEntity)) { + workTicketVo.setWorkTicketDelay(workTicketDelayEntity); + } + + + //5.工作结束 + WorkTicketFinish workTicketFinish = workTicketFinishService.selectByTicketId(ticketId); + if (ObjectUtils.isNotEmpty(workTicketFinish)) { + workTicketVo.setWorkTicketFinish(workTicketFinish); + } + + + //6.工作开始时间和结束时间 + List workTicketOperateTimeEntities = + workTicketOperateTimeService.selectByTicketId(ticketId); + if (CollectionUtils.isNotEmpty(workTicketOperateTimeEntities)) { + workTicketVo.setWorkTicketOperateTimeEntities(workTicketOperateTimeEntities); + } + + + //7. 工作票负责人变更 + WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = + workTicketPrincipalChangeService.selectByTicketId(ticketId); + if (ObjectUtils.isNotEmpty(workTicketPrincipalChangeEntity)) { + workTicketVo.setWorkTicketPrincipalChange(workTicketPrincipalChangeEntity); + } + + return workTicketVo; } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketOperateTimeServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketOperateTimeServiceImpl.java index a8418cc..702ae59 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketOperateTimeServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketOperateTimeServiceImpl.java @@ -3,6 +3,7 @@ package com.hnac.hzims.ticket.workTicket.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketOperateTimeDto; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketDelayEntity; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketOperateTimeEntity; import com.hnac.hzims.ticket.workTicket.mapper.WorkTicketOperateTimeMapper; import com.hnac.hzims.ticket.workTicket.service.IWorkTicketOperateTimeService; @@ -59,4 +60,19 @@ public class WorkTicketOperateTimeServiceImpl extends BaseServiceImpl selectByTicketId(Long ticketId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WorkTicketOperateTimeEntity::getTicketId,ticketId); + List entities = this.list(queryWrapper); + return entities; + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java index 10201ce..d6b3c99 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.ticket.constants.TicketConstants; +import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketPrincipalChangeDto; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; @@ -84,4 +85,19 @@ public class WorkTicketPrincipalChangeServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WorkTicketPrincipalChangeEntity::getTicketId,ticketId); + List workTicketPrincipalChangeEntities = this.list(queryWrapper); + return workTicketPrincipalChangeEntities.get(workTicketPrincipalChangeEntities.size() - 1); + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketSafetyMeasureServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketSafetyMeasureServiceImpl.java index dc0fe91..71fb8a7 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketSafetyMeasureServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketSafetyMeasureServiceImpl.java @@ -1,6 +1,7 @@ package com.hnac.hzims.ticket.workTicket.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -207,4 +208,19 @@ public class WorkTicketSafetyMeasureServiceImpl extends BaseServiceImpl selectByTicketId(Long ticketId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(WorkTicketSafetyMeasureEntity::getTicketId,ticketId); + List entities = this.list(queryWrapper); + return entities; + } } diff --git a/hzims-service/ticket/src/main/resources/file/新工作票.bpmn20.xml b/hzims-service/ticket/src/main/resources/file/新工作票.bpmn20.xml index fbd5498..d0fdc4b 100644 --- a/hzims-service/ticket/src/main/resources/file/新工作票.bpmn20.xml +++ b/hzims-service/ticket/src/main/resources/file/新工作票.bpmn20.xml @@ -2,18 +2,16 @@ - + - + - - + - @@ -43,45 +41,48 @@ - + - - + - + - + - + - - - + + + + - - + + - + - + + + + @@ -104,10 +105,10 @@ - + - + @@ -134,9 +135,9 @@ - - - + + + @@ -158,7 +159,7 @@ - + @@ -167,8 +168,10 @@ - - + + + + @@ -191,8 +194,8 @@ - - + + diff --git a/hzims-service/ticket/src/main/resources/template/新电气第一种工作票模板.xlsx b/hzims-service/ticket/src/main/resources/template/新电气第一种工作票模板.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..d66fefaceacc68b69abf3f45285e4ddf8699d9f7 GIT binary patch literal 14706 zcmeHO1y>x|y2afcg3|;E?hpb5cL?rIaCdii5AGfscMIGq>f7CQ&gW;BtOPg&1_%@g3 zBsU3Gh=mIjoYz{2s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