diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/aspect/TaskGenerateAspect.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/aspect/TaskGenerateAspect.java index d437893..82685fd 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/aspect/TaskGenerateAspect.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/aspect/TaskGenerateAspect.java @@ -1,25 +1,19 @@ package com.hnac.hzinfo.inspect.task.aspect; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.google.common.collect.Lists; import com.hnac.hzims.message.dto.PlanMsgRecordDto; import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzinfo.inspect.plan.entity.PlanEntity; import com.hnac.hzinfo.inspect.task.entity.TaskEntity; import com.hnac.hzinfo.inspect.task.entity.TaskUserEntity; -import com.hnac.hzinfo.inspect.task.job.service.TaskRemindManager; import com.hnac.hzinfo.inspect.task.service.ITaskService; import com.hnac.hzinfo.inspect.task.service.ITaskUserService; -import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.After; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; @@ -57,6 +51,9 @@ public class TaskGenerateAspect { **/ @Value("${hzims.inspect.task.templateCode.taskBegin}") private String taskBeginTemplateCode; + //20230627新增加短信配置 + @Value("${hzims.inspect.task.templateCode.taskBeginV2}") + private String taskBeginTemplateCodeV2; /** * 巡检任务结束前发送短信信息阿里云模板 @@ -115,7 +112,7 @@ public class TaskGenerateAspect { recordDto.setCreateUser(userId); Map smsMap = new HashMap<>(2); // 消息开始前提醒 - recordDto.setResourceCode(taskBeginTemplateCode); + recordDto.setResourceCode(taskBeginTemplateCodeV2); smsMap.put("one",taskEntity.getPlanName()); smsMap.put("two",df.format(taskEntity.getPlanStartTime())); recordDto.setPlanTime(taskEntity.getPlanStartTime()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java index a7a13e0..85486fe 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java @@ -190,6 +190,8 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{ entity.setTaskName("流程结束"); entity.setNextStepOperator("流程结束,无需人员处理"); entity.setActEndTime(new Date()); + // 开启检修任务 + this.startTaskProcess(entity); return this.planService.updateById(entity); // 审核不通过 } else if(ObjectUtil.isNotEmpty(variables.get("examine")) && !(Boolean) variables.get("examine")){ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java index 89cef1c..3dff7ec 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java @@ -10,18 +10,19 @@ import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.operational.access.dto.AccessPlanV4DTO; import com.hnac.hzims.operational.access.dto.AccessTaskV4DTO; +import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO; import com.hnac.hzims.operational.access.dto.OperAccessTaskDetailDTO; +import com.hnac.hzims.operational.access.entity.OperAccessContentEntity; import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; +import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity; import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity; -import com.hnac.hzims.operational.access.service.AccessTaskV4Service; -import com.hnac.hzims.operational.access.service.IOperAccessMaterialService; -import com.hnac.hzims.operational.access.service.IOperAccessTaskDetailService; -import com.hnac.hzims.operational.access.service.IOperAccessTaskService; +import com.hnac.hzims.operational.access.service.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.RandomUtils; 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.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.ObjectUtil; @@ -50,10 +51,14 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { private final IOperAccessTaskService taskService; + private final IOperAccessContentService contentService; + private final IOperAccessMaterialService materialService; private final IOperAccessTaskDetailService detailService; + private final IOperAccessStatisticsService statisticsService; + private final ISysClient sysClient; private final IFlowClient flowClient; @@ -176,6 +181,8 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { entity.setNextStepOperator("流程结束,无需人员处理"); // 更新任务数据 this.taskService.updateById(entity); + // 检修台账保存 + this.statiticsSave(entity); }else if(ObjectUtil.isEmpty(variables.get("examine")) && !(Boolean) variables.get("examine")){ String content = "您有一条检修任务待处理!检修任务名称:".concat(entity.getName()) .concat(",当前环节:") @@ -222,4 +229,28 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { message.setUserIds(userId); messageClient.sendAppAndWsMsgByUsers(message); } + + + /** + * 检修台账保存 + * @param entity + */ + private void statiticsSave(AccessTaskV4DTO entity) { + // 查询台账记录 + List statistics = statisticsService.list(new LambdaQueryWrapper() {{ + eq(OperAccessStatisticsEntity::getTaskId, entity.getId()); + }}); + if(CollectionUtil.isEmpty(statistics)){ + return; + } + OperAccessStatisticsDTO statisticsDTO = BeanUtil.copy(entity, OperAccessStatisticsDTO.class); + statisticsDTO.setId(null); + statisticsDTO.setTaskId(entity.getId()); + statisticsDTO.setManager(entity.getHandler()); + OperAccessContentEntity content = contentService.getById(entity.getId()); + if (ObjectUtil.isNotEmpty(content)) { + statisticsDTO.setPid(content.getLibraryId()); + } + statisticsService.doSave(statisticsDTO); + } } \ No newline at end of file