From 716cbe6e1b0a7c253937759a1b9ef87dbee466b5 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 30 Aug 2023 16:53:59 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E6=97=A5=E5=B8=B8=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BB=BB=E5=8A=A1bug=E4=BF=AE=E6=94=B9=20#?= =?UTF-8?q?=20=E5=B7=A1=E6=A3=80=E4=BB=BB=E5=8A=A1=E6=B4=BE=E5=8F=91?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=BF=87=E6=9C=9F=E4=BB=BB=E5=8A=A1=E6=9C=AA?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA=E6=9C=AA=E5=AE=8C=E6=88=90=E7=8A=B6=E6=80=81?= =?UTF-8?q?=20#=20=E5=B7=A1=E6=A3=80=E5=86=85=E5=AE=B9=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E8=BF=87=E6=BB=A4=E8=A1=A5?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../obj/entity/ContentDefinitionEntity.java | 2 + .../ticket/allTicket/entity/TicketInfoEntity.java | 71 ++++++++++++++++++++++ .../obj/services/IContentDefinitionService.java | 7 +-- .../com/hnac/hzinfo/inspect/task/job/TaskJob.java | 2 +- .../job/service/impl/ConcurrentTaskServcie.java | 4 +- .../task/job/service/impl/SeizeTaskService.java | 4 +- .../scheduled/MaintenanceTaskCreateTask.java | 16 ++--- .../service/impl/MaintenanceServiceImpl.java | 19 +++--- .../ticket/src/main/resources/db/2.0.0.sql | 14 ++++- 9 files changed, 105 insertions(+), 34 deletions(-) create mode 100644 hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/entity/TicketInfoEntity.java diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java index 7dbba17..e5b8a4e 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java @@ -39,9 +39,11 @@ public class ContentDefinitionEntity extends TenantEntity implements Serializabl private String description; @ApiModelProperty(value = "记录类型 0不记录 1仅选择 2仅记值 3选择并记值") + @QueryField(condition = SqlCondition.EQUAL) private String recordType; @ApiModelProperty(value = "检测类型") + @QueryField(condition = SqlCondition.EQUAL) private String checkType; @ApiModelProperty(value = "检测类型子类") diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/entity/TicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/entity/TicketInfoEntity.java new file mode 100644 index 0000000..ad63e24 --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/allTicket/entity/TicketInfoEntity.java @@ -0,0 +1,71 @@ +package com.hnac.hzims.ticket.allTicket.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; +import org.springblade.core.tenant.mp.TenantEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +/** + * @ClassName TicketInfoEntity + * @description: + * @author: hx + * @create: 2023-08-30 08:30 + * @Version 4.0 + **/ +@TableName("v_hzims_ticket_info") +@ApiModel("两票合计对象") +@Data +public class TicketInfoEntity extends TenantEntity { + @ApiModelProperty("审批流程ID") + @QueryField(condition = SqlCondition.EQUAL) + private String processInstanceId; + + @ApiModelProperty(value = "关联业务类型") + @QueryField(condition = SqlCondition.EQUAL) + private String type; + + @ApiModelProperty(value = "单位") + @QueryField(condition = SqlCondition.LIKE) + private String company; + + @ApiModelProperty(value = "编号") + @QueryField(condition = SqlCondition.LIKE) + private String code; + + @ApiModelProperty(value = "关联业务类型") + @QueryField(condition = SqlCondition.EQUAL) + private String taskType; + + @ApiModelProperty(value = "关联业务ID") + @QueryField(condition = SqlCondition.EQUAL) + @JsonSerialize(nullsUsing = NullSerializer.class) + private Long taskId; + + @ApiModelProperty("关联业务名称") + @QueryField(condition = SqlCondition.LIKE) + private String taskName; + + @ApiModelProperty(value = "计划开始时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime planStartTime; + + @ApiModelProperty(value = "计划结束时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime planEndTime; + + @ApiModelProperty("流程描述") + private String flowDescription; + +} diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java index 268cd14..9960a71 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/IContentDefinitionService.java @@ -26,13 +26,10 @@ public interface IContentDefinitionService extends BaseService list(ContentDefinitionDTO request); default LambdaQueryWrapper getQueryWrapper(ContentDefinitionEntity entity) { - LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(entity,ContentDefinitionEntity.class); + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(ContentDefinitionEntity.class,entity); queryWrapper.eq(Func.isNotEmpty(entity.getCreateDept()), ContentDefinitionEntity::getCreateDept, entity.getCreateDept()) .eq(Func.isNotEmpty(entity.getCreateUser()), ContentDefinitionEntity::getCreateUser, entity.getCreateUser()) - .eq(Func.isNotEmpty(entity.getStatus()), ContentDefinitionEntity::getStatus, entity.getStatus()).orderByDesc(ContentDefinitionEntity::getCreateTime) - .eq(Func.isNotEmpty(entity.getCheckType()),ContentDefinitionEntity::getCheckType,entity.getCheckType()) - .eq(Func.isNotEmpty(entity.getRecordType()),ContentDefinitionEntity::getRecordType,entity.getRecordType()) - .like(Func.isNotEmpty(entity.getName()),ContentDefinitionEntity::getName,entity.getName()); + .eq(Func.isNotEmpty(entity.getStatus()), ContentDefinitionEntity::getStatus, entity.getStatus()).orderByDesc(ContentDefinitionEntity::getCreateTime); return queryWrapper; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/TaskJob.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/TaskJob.java index 2f6f69b..dc413e6 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/TaskJob.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/TaskJob.java @@ -106,7 +106,7 @@ public class TaskJob { UpdateWrapper uwTask = new UpdateWrapper<>(); uwTask.lambda().set(TaskEntity::getStatus, Integer.valueOf(TaskStatusEnum.UNFINISH_STATUS.getStatus())) .ne(TaskEntity::getStatus, Integer.valueOf(TaskStatusEnum.FINISH_STATUS.getStatus())) - .lt(TaskEntity::getPlanEndTime, LocalDate.now()); + .lt(TaskEntity::getPlanEndTime, LocalDateTime.now()); taskService.update(uwTask); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/ConcurrentTaskServcie.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/ConcurrentTaskServcie.java index 8dd37ee..ad2a840 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/ConcurrentTaskServcie.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/ConcurrentTaskServcie.java @@ -105,8 +105,8 @@ public class ConcurrentTaskServcie extends TaskJobService implements ITaskJobSer //添加到提醒cache task.setUserId(user.getUserId()); - remindCacheManager.addTaskToCacheList(task); - taskVideoManager.addTaskToVideoCacheList(task); +// remindCacheManager.addTaskToCacheList(task); +// taskVideoManager.addTaskToVideoCacheList(task); } } if (taskUserList.size() > 0) { diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/SeizeTaskService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/SeizeTaskService.java index e499c96..be17cef 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/SeizeTaskService.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/impl/SeizeTaskService.java @@ -88,8 +88,8 @@ public class SeizeTaskService extends TaskJobService implements ITaskJobService taskUserList.add(this.getTaskUser(user.getUserId(),task.getId(),plan.getTenantId())); //添加到提醒cache task.setUserId(user.getUserId()); - remindCacheManager.addTaskToCacheList(task); - taskVideoManager.addTaskToVideoCacheList(task); +// remindCacheManager.addTaskToCacheList(task); +// taskVideoManager.addTaskToVideoCacheList(task); } String reason = this.distributeTaskObjs(plan,task); if(reason.equals(StringUtils.EMPTY)){ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java index 5ffefac..3f35b46 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java @@ -195,17 +195,11 @@ public class MaintenanceTaskCreateTask { Map params = new HashMap() {{ put("taskId", taskEntity.getId()); String userId = taskEntity.getDisposer(); - String[] userArr = taskEntity.getDisposer().split(","); - for(int index = 0; index < userArr.length ; index++){ - if(index > 4){ - continue; - } - if(index > 0){ - put("initUserIds" + index , "taskUser_".concat(userArr[index])); - }else{ - put("initUserIds", "taskUser_".concat(userArr[index])); - } - } + List userIds = Stream.of(userId.split(",")).collect(Collectors.toList()); + Stream.iterate(0, i -> i + 1).limit(5).forEach(index -> { + String key = index == 0 ? "initUserIds" : "initUserIds".concat(String.valueOf(index)); + put(key,index + 1 > userIds.size() ? "" : "taskUser_".concat(userIds.get(index))); + }); put("operMaintenanceTaskEntityVo",vo); }}; R flowResult = flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java index a884ff5..445c4e7 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java @@ -6,6 +6,7 @@ import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.google.common.collect.Lists; import com.hnac.hzims.common.utils.DateUtil; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.BusinessMessageDTO; @@ -50,6 +51,7 @@ import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ThreadPoolExecutor; import java.util.stream.Collectors; +import java.util.stream.Stream; import static org.springblade.core.tool.utils.DateUtil.PATTERN_DATE; @@ -357,22 +359,15 @@ public class MaintenanceServiceImpl implements MaintenanceService { if(flag){ params.put("startFlowUserId", taskEntity.getCreateUser().toString()); } - String[] userArr = taskEntity.getDisposer().split(","); - for(int index = 0; index < userArr.length ; index++){ - if(index > 4){ - continue; - } - if(index > 0){ - params.put("initUserIds" + index , "taskUser_".concat(userArr[index])); - }else{ - params.put("initUserIds", "taskUser_".concat(userArr[index])); - } - } + List userIds = Stream.of(taskEntity.getDisposer().split(",")).collect(Collectors.toList()); + Stream.iterate(0, i -> i + 1).limit(5).forEach(index -> { + String key = index == 0 ? "initUserIds" : "initUserIds".concat(String.valueOf(index)); + params.put(key,index + 1 > userIds.size() ? "" : "taskUser_".concat(userIds.get(index))); + }); params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params).getData().getProcessInstanceId(); } - /* 推送日常维护任务消息 diff --git a/hzims-service/ticket/src/main/resources/db/2.0.0.sql b/hzims-service/ticket/src/main/resources/db/2.0.0.sql index 841a758..ed7ad42 100644 --- a/hzims-service/ticket/src/main/resources/db/2.0.0.sql +++ b/hzims-service/ticket/src/main/resources/db/2.0.0.sql @@ -158,4 +158,16 @@ update hzims_standard_ticket_info set flow_task_name = '终止' where status = alter table hzims_ticket_count add wrong_ticket_num int null comment '错票数量'; alter table hzims_ticket_count add percent_pass_ticket varchar(50) null comment '合格率'; --- +-- 两票开票视图 +create or replace view v_hzims_ticket_info as +select hzims_ticket_info.* from +(select `id`, `process_instance_id`, `type`, `company`, `code`, `task_type`, `task_id`, `task_name`, `plan_start_time`, + `plan_end_time`, `status`,`tenant_id`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, + `create_dept`,`flow_description` + from hzims_work_ticket_info + union all + select `id`, `process_instance_id`, `ticket_type` type, `company`, `code`, `task_type`, `task_id`, `task_name`, + `start_time` plan_start_time, `end_time` plan_end_time, `status`,`tenant_id`, `create_user`, `create_time`, + `update_user`, `update_time`, `is_deleted`, `create_dept`,`flow_description` + from hzims_standard_ticket_info +) hzims_ticket_info where hzims_ticket_info.IS_DELETED = 0;