From cf84817ab8cd2e8b642982a7655ea05e83d3b2a9 Mon Sep 17 00:00:00 2001 From: tyty Date: Wed, 7 Jun 2023 14:53:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=80=BC=E7=8F=AD=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E9=86=92=EF=BC=8C=E5=8F=96=E6=B6=88=E7=BB=99=E7=AB=99?= =?UTF-8?q?=E9=95=BF=E5=8F=91=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/duty/service/impl/ImsDutyRecServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index fc0c4c3..d9ea6ec 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -645,8 +645,8 @@ public class ImsDutyRecServiceImpl extends BaseServiceImplOperationalConstants.MessageRecTypeEnum.DELAYED_HAND_REC_MESSAGE.getVal()&&differMinute 0 && one.getDelayStatus() == 0&&differMinute < 15) { //提醒站长 接班人 交班人 - User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); - remondingStationV2(carryMainentity.getDutyDate(),admin, admin.getName(), classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长 +// User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); +// remondingStationV2(carryMainentity.getDutyDate(),admin, admin.getName(), classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长 remondingCarryV2(carryMainentity.getDutyDate(),2, carryManagerId, user.getData().getName(), classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人 } } From 15a79f8bbb5d7a0ec16d0dd478d867800a1e7476 Mon Sep 17 00:00:00 2001 From: tyty Date: Wed, 7 Jun 2023 16:24:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=80=BC=E7=8F=AD=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E9=86=92=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=8F=91=E7=BB=99?= =?UTF-8?q?=E7=AB=99=E9=95=BF=E9=80=BB=E8=BE=91=EF=BC=8C=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E6=98=AFadmin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../duty/service/impl/ImsDutyRecServiceImpl.java | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index d9ea6ec..c436f19 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -645,8 +645,16 @@ public class ImsDutyRecServiceImpl extends BaseServiceImplOperationalConstants.MessageRecTypeEnum.DELAYED_HAND_REC_MESSAGE.getVal()&&differMinute> stationAgent = userClient.relationUserListByRoleAlias(entity.getTenantId(), entity.getCreateDept(), "stationAgent"); + //提醒站长 + if (stationAgent.isSuccess()){ + List data = stationAgent.getData(); + if (CollectionUtil.isNotEmpty(data)){ + for (User admin : data) { + remondingStationV2(carryMainentity.getDutyDate(),admin, userName, classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长 + } + } + } remondingCarryV2(carryMainentity.getDutyDate(),OperationalConstants.RecTypeEnum.HAND_DELAY.getVal(), carryManagerId, userName, classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人 remondingHeadV2(carryMainentity.getDutyDate(),OperationalConstants.RecTypeEnum.HAND_DELAY.getVal(), groupEntityManagerId, userName, entity.getTenantId(), entity.getCreateDept(), entity.getId(), entity.getCreateUser());//提醒交班人 } @@ -655,8 +663,16 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl 0 && one.getDelayStatus() == 0&&differMinute < 15) { //提醒站长 接班人 交班人 -// User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); -// remondingStationV2(carryMainentity.getDutyDate(),admin, admin.getName(), classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长 + R> stationAgent = userClient.relationUserListByRoleAlias(entity.getTenantId(), entity.getCreateDept(), "stationAgent"); + //提醒站长 + if (stationAgent.isSuccess()){ + List data = stationAgent.getData(); + if (CollectionUtil.isNotEmpty(data)){ + for (User admin : data) { + remondingStationV2(carryMainentity.getDutyDate(),admin, userName, classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser()); + } + } + } remondingCarryV2(carryMainentity.getDutyDate(),2, carryManagerId, user.getData().getName(), classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人 } } @@ -975,7 +991,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl Date: Thu, 8 Jun 2023 11:41:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=A5=A8=E6=B5=8F?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/StandardTicketInfoEntity.java | 310 ++++++++++----------- .../entity/StandardTicketMeasureEntity.java | 67 ++--- .../controller/OperationTicketController.java | 22 +- .../service/IStandardTicketInfoService.java | 8 + .../service/IStandardTicketMeasureService.java | 7 + .../service/OperationTicketService.java | 11 + .../service/impl/OperationTicketServiceImpl.java | 92 ++++++ .../impl/StandardTicketInfoServiceImpl.java | 61 +++- .../impl/StandardTicketMeasureServiceImpl.java | 13 + .../standardTicket/utils/OperationWordHelper.java | 121 ++++++++ .../service/impl/TicketProcessServiceImpl.java | 1 + .../hzims/ticket/twoTicket/utils/WordHelper.java | 2 +- .../vo/operation/StandardTicketInfoVo.java | 36 +++ .../vo/operation/StandardTicketMeasureVo.java | 5 + 14 files changed, 557 insertions(+), 199 deletions(-) create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java index 62c627d..db4adbc 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java @@ -20,167 +20,161 @@ import java.time.LocalDateTime; @EqualsAndHashCode @Data @TableName("hzims_standard_ticket_info") -@ApiModel(value = "标准票对象",description = "标准票对象") +@ApiModel(value = "标准票对象", description = "标准票对象") public class StandardTicketInfoEntity extends TenantEntity implements Serializable { - private static final long serialVersionUID = 8278603728783507684L; - - @ApiModelProperty("票据类型") - @QueryField(condition = SqlCondition.EQUAL) - private String ticketType; - - @ApiModelProperty("单位") - @QueryField(condition = SqlCondition.EQUAL) - private String company; - - @ApiModelProperty("工作流ID") - @QueryField(condition = SqlCondition.EQUAL) - private String processInstanceId; - - @ApiModelProperty("编号") - @QueryField(condition = SqlCondition.EQUAL) - private String code; - - @ApiModelProperty("发令人") - @QueryField(condition = SqlCondition.EQUAL) - private Long issueOrderPerson; - - @ApiModelProperty("受令人") - @QueryField(condition = SqlCondition.EQUAL) - private Long accessOrderPerson; - - @ApiModelProperty("发令时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime issueOrderTime; - - @ApiModelProperty("操作开始时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime startTime; - - @ApiModelProperty("操作结束时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime endTime; - - @ApiModelProperty("操作任务") - @QueryField(condition = SqlCondition.EQUAL) - private String title; - - @ApiModelProperty("任务类型") - @QueryField(condition = SqlCondition.EQUAL) - private String taskType; - - @ApiModelProperty("关联业务任务ID") - private Long taskId; - - @ApiModelProperty("关联业务名称") - @QueryField(condition = SqlCondition.LIKE) - private String taskName; - - @ApiModelProperty("备注") - private String remark; - - @ApiModelProperty("监护人") - private Long guardian; - - @ApiModelProperty("操作人") - private Long operator; - - @ApiModelProperty("操作时间") - private LocalDateTime operateTime; - - @ApiModelProperty("负责人确认时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime guardianshipTime; - - @ApiModelProperty("值班负责人") - private Long principal; - - @ApiModelProperty("值班负责人确认时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - private LocalDateTime principalTime; - - @ApiModelProperty("是否评价") - private Integer isEvaluate; - - - /** - * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性 - * 站点标识-两票编码 - */ - @ApiModelProperty("站点标识-两票编码") - private String signage; - - - /** - * 编号(原站点ID) - */ - @ApiModelProperty("编号(原站点ID)") - private String signageCode; - - - /** - * 流程状态' - */ - @ApiModelProperty("流程状态") - private Integer flowStatus; - - /** - * 流程描述 - */ - @ApiModelProperty("流程描述") - private String flowDescription; - - - /** - * 下一个审批人 - */ - @ApiModelProperty("下一个审批人") - private String nextStepOperator; - - - /** - * 用户Id - */ - @ApiModelProperty("用户Id") - private String flowUserId; - - - /** - * 当前任务名 - */ - @ApiModelProperty("当前任务名") - private String flowTaskName; + private static final long serialVersionUID = 8278603728783507684L; + @ApiModelProperty("票据类型") + @QueryField(condition = SqlCondition.EQUAL) + private String ticketType; - /** - * 当前任务名 - */ - @ApiModelProperty("当前任务名") - private String flowTaskId; + @ApiModelProperty("单位") + @QueryField(condition = SqlCondition.EQUAL) + private String company; + + @ApiModelProperty("工作流ID") + @QueryField(condition = SqlCondition.EQUAL) + private String processInstanceId; + + @ApiModelProperty("编号") + @QueryField(condition = SqlCondition.EQUAL) + private String code; + + @ApiModelProperty("发令人") + @QueryField(condition = SqlCondition.EQUAL) + private Long issueOrderPerson; + + @ApiModelProperty("受令人") + @QueryField(condition = SqlCondition.EQUAL) + private Long accessOrderPerson; + + @ApiModelProperty("发令时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime issueOrderTime; + + @ApiModelProperty("操作开始时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + @ApiModelProperty("操作结束时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + @ApiModelProperty("操作任务") + @QueryField(condition = SqlCondition.EQUAL) + private String title; + + @ApiModelProperty("任务类型") + @QueryField(condition = SqlCondition.EQUAL) + private String taskType; + + @ApiModelProperty("关联业务任务ID") + private Long taskId; + + @ApiModelProperty("关联业务名称") + @QueryField(condition = SqlCondition.LIKE) + private String taskName; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("监护人") + private Long guardian; + + @ApiModelProperty("操作人") + private Long operator; + + @ApiModelProperty("操作时间") + private LocalDateTime operateTime; + + @ApiModelProperty("负责人确认时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime guardianshipTime; + + @ApiModelProperty("值班负责人") + private Long principal; + + @ApiModelProperty("值班负责人确认时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime principalTime; + + @ApiModelProperty("是否评价") + private Integer isEvaluate; + + + /** + * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性 + * 站点标识-两票编码 + */ + @ApiModelProperty("站点标识-两票编码") + private String signage; + + + /** + * 编号(原站点ID) + */ + @ApiModelProperty("编号(原站点ID)") + private String signageCode; + + + /** + * 流程状态' + */ + @ApiModelProperty("流程状态") + private Integer flowStatus; + + /** + * 流程描述 + */ + @ApiModelProperty("流程描述") + private String flowDescription; + + + /** + * 下一个审批人 + */ + @ApiModelProperty("下一个审批人") + private String nextStepOperator; + + + /** + * 用户Id + */ + @ApiModelProperty("用户Id") + private String flowUserId; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskName; + + + /** + * 当前任务名 + */ + @ApiModelProperty("当前任务名") + private String flowTaskId; + + + /** + * 项目 + */ + @ApiModelProperty("项目") + private String projectName; + + + /** + * + */ + @ApiModelProperty("分组") + private String classGroupName; } diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketMeasureEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketMeasureEntity.java index d27b61a..e618a74 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketMeasureEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketMeasureEntity.java @@ -22,49 +22,50 @@ import java.time.LocalDateTime; * @author hx */ @Data -@ApiModel(value = "标准票安全措施明细",description = "标准票安全措施明细") +@ApiModel(value = "标准票安全措施明细", description = "标准票安全措施明细") @EqualsAndHashCode @TableName("hzims_standard_ticket_measure") public class StandardTicketMeasureEntity extends TenantEntity implements Serializable { - private static final long serialVersionUID = 8503146008417850183L; + private static final long serialVersionUID = 8503146008417850183L; - @ApiModelProperty("标准票ID") - @QueryField(condition = SqlCondition.EQUAL) - private Long ticketId; + @ApiModelProperty("标准票ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long ticketId; - @ApiModelProperty("分组") - private Long matterGroup; + @ApiModelProperty("分组") + private Long matterGroup; - @ApiModelProperty("安全措施ID") - @QueryField(condition = SqlCondition.EQUAL) - private Long measureId; + @ApiModelProperty("安全措施ID") + @QueryField(condition = SqlCondition.EQUAL) + private Long measureId; - @ApiModelProperty("安全措施") - @QueryField(condition = SqlCondition.LIKE) - private String measure; + @ApiModelProperty("安全措施") + @QueryField(condition = SqlCondition.LIKE) + private String measure; - @ApiModelProperty("执行人") - @TableField(updateStrategy = FieldStrategy.IGNORED) - @QueryField(condition = SqlCondition.EQUAL) - private Long executor; + @ApiModelProperty("执行人") + @TableField(updateStrategy = FieldStrategy.IGNORED) + @QueryField(condition = SqlCondition.EQUAL) + private Long executor; - @ApiModelProperty("执行时间") - @DateTimeFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @JsonFormat( - pattern = "yyyy-MM-dd HH:mm:ss" - ) - @TableField(updateStrategy = FieldStrategy.IGNORED) - private LocalDateTime executeTime; + @ApiModelProperty("执行时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(updateStrategy = FieldStrategy.IGNORED) + private LocalDateTime executeTime; - @ApiModelProperty("执行图片") - private String executeImgUrl; + @ApiModelProperty("执行图片") + private String executeImgUrl; - @ApiModelProperty("执行备注") - private String remark; + @ApiModelProperty("执行备注") + private String remark; - @ApiModelProperty("操作事项排序") - @JsonSerialize(nullsUsing = NullSerializer.class) - private Integer sort; + @ApiModelProperty("操作事项排序") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer sort; + + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime operationTime; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java index b47e1e2..da8ccc5 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java @@ -1,16 +1,15 @@ package com.hnac.hzims.ticket.standardTicket.controller; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; -import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; -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 javax.servlet.http.HttpServletResponse; /** * 操作票 @@ -44,4 +43,17 @@ public class OperationTicketController { + /** + * 新预览 + */ + @GetMapping("/newPreview") + @ApiOperation(value = "新预览") + @ApiOperationSupport(order = 11) + public void preview(@RequestParam(value = "ticketId", required = true) Long ticketId, + @RequestParam(value = "status", required = true) Integer status, + HttpServletResponse response) { + operationTicketService.newPreview(ticketId, status, response); + } + + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java index be22563..b4aaa2e 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java @@ -10,6 +10,7 @@ import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; +import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.BladePage; @@ -109,4 +110,11 @@ public interface IStandardTicketInfoService extends BaseService areaMonthlyWithOperation(StandardTicketWithAreaVo areaMonthly, Page searchPage); + + /** + * 根据Id获取操作票详细信息 + * @param ticketId + * @return + */ + StandardTicketInfoVo selectDetailsById(Long ticketId); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketMeasureService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketMeasureService.java index 4e70335..c00c67e 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketMeasureService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketMeasureService.java @@ -61,4 +61,11 @@ public interface IStandardTicketMeasureService extends BaseService listStandardByTicketId(Long ticketId); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java index f92497d..3f4dc34 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java @@ -4,6 +4,8 @@ import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import javax.servlet.http.HttpServletResponse; + /** * @Author WL * @Version v1.0 @@ -25,4 +27,13 @@ public interface OperationTicketService { * @param response */ void findPending(ProcessWorkFlowResponse response); + + + /** + * 新预览 + * @param ticketId 操作票id + * @param status 状态 + * @param response 扩展 ServletResponse 接口以在发送响应时提供特定于 HTTP 的功能。例如,它具有访问HTTP标头和cookie的方法。 + */ + void newPreview(Long ticketId, Integer status, HttpServletResponse response); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index 7934a21..38811fb 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java @@ -1,7 +1,9 @@ package com.hnac.hzims.ticket.standardTicket.service.impl; +import cn.afterturn.easypoi.word.WordExportUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; @@ -9,6 +11,7 @@ import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.processflow.service.ProcessDictService; import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; @@ -17,15 +20,24 @@ import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketMeasureEntity; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketMeasureService; import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService; +import com.hnac.hzims.ticket.standardTicket.utils.OperationWordHelper; +import com.hnac.hzims.ticket.twoTicket.constant.TicketConstant; +import com.hnac.hzims.ticket.twoTicket.utils.WordHelper; +import com.hnac.hzims.ticket.twoTicket.utils.WordMapUtils; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketMeasureVo; +import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; +import com.hnac.hzims.ticket.utils.PdfUtils; import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.feign.IFlowClient; import org.springblade.system.feign.ISysClient; @@ -34,10 +46,13 @@ import org.springblade.system.user.entity.User; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.OPERATION_TICKET_KEY; @@ -221,6 +236,7 @@ public class OperationTicketServiceImpl implements OperationTicketService { } } + /** * 填充数据 * @@ -357,4 +373,80 @@ public class OperationTicketServiceImpl implements OperationTicketService { } return result; } + + + + + /** + * 新预览 + * + * @param ticketId 操作票id + * @param status 状态 + * @param response 扩展 ServletResponse 接口以在发送响应时提供特定于 HTTP 的功能。例如,它具有访问HTTP标头和cookie的方法。 + */ + @SneakyThrows + @Override + public void newPreview(Long ticketId, Integer status, HttpServletResponse response) { + String fileName = IdWorker.get32UUID() + ".docx"; + response.setHeader("Content-Disposition", "attachment; filename=" + fileName); + response.setContentType("application/vnd.ms-excel;charset=utf-8"); + + StandardTicketInfoVo standardTicketInfoVo = standardTicketInfoService.selectDetailsById(ticketId); + //将查询的数据转换为map + Map workTicketInfoMap = this.convertMap(standardTicketInfoVo); + //导入下在word + Map resultMap = OperationWordHelper.resultMap(workTicketInfoMap); + String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status); + String os = TicketConstant.OS_NAME; + //Windows操作系统 + if (os != null && os.toLowerCase().startsWith("windows")) { + String url = "template/" + workTicketStatus; + XWPFDocument doc = WordExportUtil.exportWord07(url, resultMap); + log.info("当前系统版本是:{}", os); + doc.write(response.getOutputStream()); + } else { + String url = TicketConstant.TICKET_LIUNX_PATH + "/" + workTicketStatus; + XWPFDocument doc = WordExportUtil.exportWord07(url, resultMap); + //其它操作系统 + log.info("当前系统版本是:{}", os); + ServletOutputStream outputStream = response.getOutputStream(); + doc.write(outputStream); + } + } + + + /** + * 将查询的数据转换为map + * @param standardTicketInfoVo + * @return + */ + private Map convertMap(StandardTicketInfoVo standardTicketInfoVo) { + //1. 操作票装换map + Map result = new HashMap<>(); + Map stringObjectMap = PdfUtils.objectToMapResult(standardTicketInfoVo, result); + result.putAll(stringObjectMap); + //2. 安全措施转换map + List standardTicketMeasureVos = standardTicketInfoVo.getStandardTicketMeasureVos(); + AtomicInteger index = new AtomicInteger(1); + if (CollectionUtil.isNotEmpty(standardTicketMeasureVos)) { + List> measureMapLists = new ArrayList<>(); + for (StandardTicketMeasureVo measure : standardTicketMeasureVos) { + Map map = PdfUtils.objectToMap(measure); + map.put("index", index.get()); + map.put("status", TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : ""); + map.put("operationTime", measure.getOperationTime()); + map.put("hello",""); + map.put("hello1",""); + index.getAndIncrement(); + measureMapLists.add(map); + } + result.put("measureMapList", measureMapLists); + }else { + result.put("measureMapList", new ArrayList<>()); + } + + WordMapUtils.newMapWithList("measureMapList",result,false,17,null); + return result; + } + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java index 5b528a8..1a97a48 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java @@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -21,6 +22,7 @@ import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketMeasureDto; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; +import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketMeasureEntity; import com.hnac.hzims.ticket.standardTicket.mapper.StandardTicketInfoMapper; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketMeasureService; @@ -28,6 +30,8 @@ import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketMeasureVO; import com.hnac.hzims.ticket.standardTicket.wrapper.StandardTicketInfoWrapper; +import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; +import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketMeasureVo; import com.hnac.hzims.ticket.utils.ExcelUtil; import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; @@ -109,7 +113,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl> queryList(StandardTicketInfoDto req, Query query) { LambdaQueryWrapper queryWrapper = this.getQueryWrapper(req); - queryWrapper.eq(Func.isNotEmpty(req.getCreateDept()),StandardTicketInfoEntity::getCreateDept,req.getCreateDept()); + queryWrapper.eq(Func.isNotEmpty(req.getCreateDept()), StandardTicketInfoEntity::getCreateDept, req.getCreateDept()); queryWrapper.orderByDesc(StandardTicketInfoEntity::getCreateTime); IPage pages = super.page(Condition.getPage(query), queryWrapper); return R.data(pages.setRecords(StandardTicketInfoWrapper.build().listVO(pages.getRecords()))); @@ -337,7 +341,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl standardTicketMeasure = measureService.listStandardByTicketId(ticketId); + if (CollectionUtils.isNotEmpty(standardTicketMeasure)){ + List collect = standardTicketMeasure.stream().map(standardTicketMeasureEntity -> { + StandardTicketMeasureVo standardTicketMeasureVO = new StandardTicketMeasureVo(); + BeanUtils.copyProperties(standardTicketMeasureEntity, standardTicketMeasureVO); + return standardTicketMeasureVO; + }).collect(Collectors.toList()); + standardTicketInfoVo.setStandardTicketMeasureVos(collect); + } + return standardTicketInfoVo; + } + + + /** + * 封装Vo + * @param standardTicketInfoVo + * @param standardTicketInfoEntity + */ + private static void transFrom(StandardTicketInfoVo standardTicketInfoVo, StandardTicketInfoEntity standardTicketInfoEntity) { + User creator = UserCache.getUser(standardTicketInfoEntity.getCreateUser()); + User updater = UserCache.getUser(standardTicketInfoEntity.getUpdateUser()); + /*发令人、受令人、负责人、监护人*/ + User issueOrderPerson = UserCache.getUser(standardTicketInfoEntity.getIssueOrderPerson()); + User accessOrderPerson = UserCache.getUser(standardTicketInfoEntity.getAccessOrderPerson()); + User principal = UserCache.getUser(standardTicketInfoEntity.getPrincipal()); + User guardian = UserCache.getUser(standardTicketInfoEntity.getGuardian()); + standardTicketInfoVo.setCreateUserName(Optional.ofNullable(creator).map(User::getName).orElse(null)); + standardTicketInfoVo.setUpdateUserName(Optional.ofNullable(updater).map(User::getName).orElse(null)); + standardTicketInfoVo.setIssueOrderPersonName(Optional.ofNullable(issueOrderPerson).map(User::getName).orElse(null)); + standardTicketInfoVo.setAccessOrderPersonName(Optional.ofNullable(accessOrderPerson).map(User::getName).orElse(null)); + standardTicketInfoVo.setPrincipalName(Optional.ofNullable(principal).map(User::getName).orElse(null)); + standardTicketInfoVo.setGuardianName(Optional.ofNullable(guardian).map(User::getName).orElse(null)); + } + /** * 判断是否存在合格率 如果存在返回true 否则为false + * * @param item * @return */ diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketMeasureServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketMeasureServiceImpl.java index a17be46..1efee00 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketMeasureServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketMeasureServiceImpl.java @@ -3,6 +3,7 @@ package com.hnac.hzims.ticket.standardTicket.service.impl; 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.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity; import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService; import com.hnac.hzims.ticket.constants.TicketConstants; @@ -125,6 +126,18 @@ public class StandardTicketMeasureServiceImpl extends BaseServiceImpl listStandardByTicketId(Long ticketId) { + return new LambdaQueryChainWrapper(baseMapper) + .eq(StandardTicketMeasureEntity::getTicketId,ticketId).list(); + } + + /** * 获取StandardTicketMeasureEntity - LambdaQueryWrapper * @param req * @return diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java new file mode 100644 index 0000000..52e4553 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java @@ -0,0 +1,121 @@ +package com.hnac.hzims.ticket.standardTicket.utils; + +import com.hnac.hzims.ticket.twoTicket.utils.WordHelper; +import lombok.AllArgsConstructor; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/6/7 17:00 + */ +public class OperationWordHelper { + + + /** + * map验证是value否为null + * + * @param workTicketInfoMap + * @return + */ + public static Map resultMap(Map workTicketInfoMap) { + Map resultMap = new HashMap<>(); + for (Map.Entry entry : workTicketInfoMap.entrySet()) { + listEntryMap(resultMap, entry.getKey(), entry.getValue()); + } + return resultMap; + } + + /** + * 根据状态获取模板 + * @param status + * @return + */ + public static String getWorkTicketStatus(Integer status) { + String result = null; + switch (status) { + case 0: + result = "电气操作票.docx"; + default: + result = "电气操作票.docx"; + } + return result; + } + + + @Data + @AllArgsConstructor + static class Entry { + /** + * key值 + */ + private String fileName; + + /** + * count + */ + private Integer count; + + } + + + /** + * 判断是否存在,如果不存在空格代替 + * @param resultMap + * @param key + * @param value + */ + private static void listEntryMap(Map resultMap, String key, Object value) { + List params = new ArrayList<>(); + paramsList(params); + for (Entry entry : params) { + isEntryMap(resultMap, entry.getFileName(), key, value, entry.getCount()); + } + } + + + /** + * 验证空格多少 + * @param resultMap + * @param fileName + * @param key + * @param value + * @param count + */ + private static void isEntryMap(Map resultMap, String fileName, String key, Object value, Integer count) { + if (fileName.equals(key)) { + Object newValue = StringUtils.isNoneBlank(WordHelper.toString(value).trim()) ? value : + "\u00A0" + WordHelper.printSpace(count); + resultMap.put(key, newValue); + } else { + Object newValue = StringUtils.isNoneBlank(WordHelper.toString(value).trim()) ? value : + "\u00A0" + WordHelper.printSpace(5); + resultMap.put(key, newValue); + } + } + + + /** + * 存储数据,要加载多少空格 + * @param params + */ + private static void paramsList(List params) { + params.add(new Entry("projectName", 10)); + params.add(new Entry("classGroupName", 10)); + params.add(new Entry("code", 10)); + params.add(new Entry("accessOrderPersonName", 10)); + params.add(new Entry("guardianName", 10)); + params.add(new Entry("startTime", 10)); + params.add(new Entry("endTime", 10)); + params.add(new Entry("principalName", 10)); + params.add(new Entry("principalTime", 10)); + } +} 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 d536b9d..47bb99b 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 @@ -440,6 +440,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { message.setCreateUser(NumberUtils.toLong(userId)); messageClient.sendMessage(message); + log.info("推送消息成功,用户名称{},消息{}", user.getName(), message); } } catch (Exception e) { e.printStackTrace(); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java index e8505ad..1b6fca6 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java @@ -152,7 +152,7 @@ public class WordHelper extends StringUtils { } /** - * + *判断是否存在,如果不存在空格代替 */ public static void listEntryMap(Map result, String key, Object value) { List params = new ArrayList<>(); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java index 70ca8e5..7f02ef8 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java @@ -107,12 +107,48 @@ public class StandardTicketInfoVo extends TenantEntity { /** + * 项目 + */ + @ApiModelProperty("项目") + private String projectName; + + + /** + * + */ + @ApiModelProperty("分组") + private String classGroupName; + + + /** * 编号(原站点ID) */ @ApiModelProperty("编号(原站点ID)") private String signageCode; + + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("更新人名称") + private String updateUserName; + + @ApiModelProperty("来源类型名称") + private String taskTypeName; + + @ApiModelProperty("发令人名称") + private String issueOrderPersonName; + + @ApiModelProperty("受令人名称") + private String accessOrderPersonName; + + @ApiModelProperty("负责人名称") + private String principalName; + + @ApiModelProperty("许可人名称") + private String guardianName; + /** * 安全措施 */ diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketMeasureVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketMeasureVo.java index 03702a7..10e7039 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketMeasureVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketMeasureVo.java @@ -54,4 +54,9 @@ public class StandardTicketMeasureVo extends TenantEntity { @ApiModelProperty("操作事项排序") private Integer sort; + + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime operationTime; }