From 5b2f100d173a6f660766b4be3581ea16302775e0 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 26 Jun 2023 17:29:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?#=E6=A3=80=E4=BF=AE=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) 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")){ From bf0b40d5594c8f55591c30cb6e08e28a23160be7 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Tue, 27 Jun 2023 10:59:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?#=E6=A3=80=E4=BF=AE=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AccessTaskV4ServiceImpl.java | 39 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) 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