From 2c4ea94474ce8f9eb48b71fb9960a7da45320282 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期二, 06 五月 2025 13:58:46 +0800
Subject: [PATCH] 代码初始化

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
index 547151c..b3b083b 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -131,6 +131,8 @@
     @Autowired
     private PlatformWarnEventServiceImpl platformWarnEventService;
     @Autowired
+    private PlatformWarnEventMapper platformWarnEventMapper;
+    @Autowired
     private MemberMapper memberMapper;
     @Autowired
     private WxNoticeConfigMapper wxNoticeConfigMapper;
@@ -1141,6 +1143,11 @@
                         if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.DONE.getKey())){
                             //濡傛灉宸蹭笅鍙戞垚鍔燂紝鏍囪宸叉巿鏉冪鍥姸鎬�
                             platformJob.setStatus(Constants.PlatformJobStatus.AUTHED_LEAVE.getKey());
+                            //鍒犻櫎鎶ヨ淇℃伅
+                            platformWarnEventMapper.update(new UpdateWrapper<PlatformWarnEvent>().lambda()
+                                    .set(PlatformWarnEvent::getIsdeleted,Constants.ONE)
+                                    .eq(PlatformWarnEvent::getPlatformId,platformJob.getId())
+                            );
                         }
                     }else{
                         platformJob.setInHkstatus(Constants.THREE);
@@ -1605,6 +1612,12 @@
         //瀛樺偍鎿嶄綔鏃ュ織
         savePlatformLog(Constants.PlatformJobLogType.DONE.getKey(),oldPlatformJob,platformJob ,
                 Constants.PlatformJobLogType.DONE.getInfo());
+        
+        //鍒犻櫎鎶ヨ淇℃伅
+        platformWarnEventMapper.update(new UpdateWrapper<PlatformWarnEvent>().lambda()
+                .set(PlatformWarnEvent::getIsdeleted,Constants.ONE)
+                .eq(PlatformWarnEvent::getPlatformId,platformJob.getId())
+        );
 
         if(Constants.equalsInteger(platformJob.getType(),Constants.THREE)){
             // 澶栧崗杞﹁璐� 鏌ヨTMS 鐢靛瓙閿佹儏鍐�
@@ -2459,5 +2472,37 @@
 
     }
 
+    @Override
+    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+    public PlatformJob restoreWork(JobOperateDTO jobOperateDTO){
+        if(Objects.isNull(jobOperateDTO)
+                || Objects.isNull(jobOperateDTO.getJobId())){
+            throw new BusinessException(ResponseStatus.BAD_REQUEST);
+        }
+        PlatformJob platformJob = platformJobMapper.selectById(jobOperateDTO.getJobId());
+        if(Objects.isNull(platformJob)||Constants.equalsInteger(platformJob.getIsdeleted(),Constants.ONE)){
+            throw new BusinessException(ResponseStatus.DATA_EMPTY);
+        }
+        if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.EXCEPTION.getKey())){
+            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧�,涓氬姟鐘舵�佸凡娴佽浆锛�");
+        }
+        Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId());
+        if(Objects.isNull(platform)){
+            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鏈堝彴淇℃伅");
+        }
+        PlatformJob oldPlatformJob = new PlatformJob();
+        BeanUtils.copyProperties(platformJob,oldPlatformJob);
+        if(Objects.isNull(platformJob.getStartDate())){
+            platformJob.setStartDate(new Date());
+        }
+        platformJob.setStatus(Constants.PlatformJobStatus.WORKING.getKey());
+        platformJob.setEditDate(new Date());
+        platformJobMapper.updateById(platformJob);
+
+        //瀛樺偍鎿嶄綔鏃ュ織
+        savePlatformLog(Constants.PlatformJobLogType.WORKING.getKey(),oldPlatformJob,platformJob,
+                Constants.PlatformJobLogType.WORKING.getInfo().replace("{data}",platform.getName()));
+        return platformJob;
+    }
 
 }

--
Gitblit v1.9.3