From e5068dce50b56fe0e56128b91951e4d92dcf8307 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 11 十月 2024 14:48:22 +0800
Subject: [PATCH] 最新版本

---
 server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java                             |    3 +++
 admin/src/components/business/OperaPlatformWindow.vue                                                               |    6 +++---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java               |   29 +++++++++++++++++++++++++----
 admin/src/views/platform/platform.vue                                                                               |    2 +-
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java |   19 +++++++++++++++++++
 5 files changed, 51 insertions(+), 8 deletions(-)

diff --git a/admin/src/components/business/OperaPlatformWindow.vue b/admin/src/components/business/OperaPlatformWindow.vue
index b32724b..c01926d 100644
--- a/admin/src/components/business/OperaPlatformWindow.vue
+++ b/admin/src/components/business/OperaPlatformWindow.vue
@@ -26,8 +26,8 @@
           </el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="LED绌洪棽鏂囨锛�" prop="remark">
-        <el-input type="text" v-model="form.remark" placeholder="璇疯緭鍏ED绌洪棽鏂囨" v-trim />
+      <el-form-item label="LED绌洪棽鏂囨锛�" prop="ledContent">
+        <el-input type="text" v-model="form.ledContent" placeholder="璇疯緭鍏ED绌洪棽鏂囨" v-trim />
       </el-form-item>
       <el-form-item label="鍚屾椂浣滀笟鏁伴噺锛�" prop="workingNum">
         <el-input type="number" v-model="form.workingNum" placeholder="璇疯緭鍏ュ悓鏃朵綔涓氭暟閲�" v-trim />
@@ -71,7 +71,7 @@
         startTime: '',
         endTime: '',
         workingNum: 1,
-        remark: '',
+        ledContent: '',
         workRate: '',
         stayTimeoutAlarmTime: '',
         workTimeoutAlarmTime: '',
diff --git a/admin/src/views/platform/platform.vue b/admin/src/views/platform/platform.vue
index e5615f6..4d98a5a 100644
--- a/admin/src/views/platform/platform.vue
+++ b/admin/src/views/platform/platform.vue
@@ -50,7 +50,7 @@
         </el-table-column> -->
         <el-table-column prop="broadcastNames" label="鍏宠仈骞挎挱" min-width="100px"></el-table-column>
         <el-table-column prop="ledNames" label="鍏宠仈LED" min-width="100px"></el-table-column>
-        <el-table-column prop="remark" label="LED绌洪棽鏂囨" min-width="180px"></el-table-column>
+        <el-table-column prop="ledContent" label="LED绌洪棽鏂囨" min-width="180px"></el-table-column>
         <el-table-column prop="hkDate" label="鍚屾鏃堕棿" min-width="150px"></el-table-column>
         <el-table-column label="鏈堝彴鐘舵��" fixed="right" width="100px">
           <template slot-scope="{row}">
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
index 05a3247..f733483 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
@@ -65,6 +65,9 @@
     @ApiModelProperty(value = "澶囨敞")
     @ExcelColumn(name="澶囨敞")
     private String remark;
+    @ApiModelProperty(value = "led绌洪棽鏂囨")
+    @ExcelColumn(name="led绌洪棽鏂囨")
+    private String ledContent;
 
     @ApiModelProperty(value = "鐘舵�� 0姝e父 1绂佺敤", example = "1")
     @ExcelColumn(name="鐘舵�� 0姝e父 1绂佺敤")
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
index 44a60e9..e8ae4ad 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
@@ -9,10 +9,7 @@
 import com.doumee.core.utils.Constants;
 import com.doumee.core.utils.DateUtil;
 import com.doumee.core.utils.Utils;
-import com.doumee.dao.business.DeviceMapper;
-import com.doumee.dao.business.PlatformDeviceMapper;
-import com.doumee.dao.business.PlatformJobMapper;
-import com.doumee.dao.business.PlatformMapper;
+import com.doumee.dao.business.*;
 import com.doumee.dao.business.join.PlatformJobJoinMapper;
 import com.doumee.dao.business.join.PlatformJoinMapper;
 import com.doumee.dao.business.model.*;
@@ -46,6 +43,8 @@
 
     @Autowired
     private PlatformMapper platformMapper;
+    @Autowired
+    private PlatformGroupMapper platformGroupMapper;
     @Autowired
     private PlatformJoinMapper platformJoinMapper;
     @Autowired
@@ -135,6 +134,28 @@
     public void updateById(Platform platform) {
         platform.setEditor(platform.getLoginUserInfo().getId());
         platform.setEditDate(new Date());
+        Platform model = platformMapper.selectById(platform.getId());
+        if(model ==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){
+            throw new BusinessException(ResponseStatus.DATA_EMPTY);
+        }
+        if(model.getGroupId()!= null && platform.getGroupId()!=null && !Constants.equalsInteger(platform.getGroupId(),model.getGroupId())){
+            PlatformGroup group = platformGroupMapper.selectById(platform.getGroupId());
+            if(group ==null || Constants.equalsInteger(group.getIsdeleted(),Constants.ZERO)){
+                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝鏈堝彴缁勪俊鎭笉姝g‘锛�");
+            }
+            //濡傛灉鏈堝彴鍒嗙粍鍙戠敓鍙樺寲
+            Long count =  platformJobJoinMapper.selectCount(  new QueryWrapper<PlatformJob>().lambda()
+                    .eq(PlatformJob::getIsdeleted,Constants.ZERO)
+                    .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey()
+                            ,Constants.PlatformJobStatus.WAIT_CONFIRM.getKey()
+                            ,Constants.PlatformJobStatus.DONE.getKey()
+                            ,Constants.PlatformJobStatus.LEAVED.getKey()
+                            ,Constants.PlatformJobStatus.CANCEL.getKey()
+                    ));
+            if(count!=null && count>0){
+                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠鏈堝彴鏈夋鍦ㄤ綔涓氱殑浠诲姟锛屼笉鑳借繘琛屾湀鍙扮粍鍒囨崲鎿嶄綔锛�");
+            }
+        }
         //鍒犻櫎LED/骞挎挱鏁版嵁
         platformDeviceMapper.delete(new QueryWrapper<PlatformDevice>().lambda()
                 .eq(PlatformDevice::getPlatformId,platform.getId())
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java
index 10e2a89..c3a8437 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java
@@ -1,6 +1,7 @@
 package com.doumee.service.business.impl.hksync;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
@@ -13,10 +14,12 @@
 import com.doumee.core.utils.Constants;
 import com.doumee.core.utils.DateUtil;
 import com.doumee.dao.business.PlatformDeviceMapper;
+import com.doumee.dao.business.PlatformJobMapper;
 import com.doumee.dao.business.PlatformMapper;
 import com.doumee.dao.business.model.Device;
 import com.doumee.dao.business.model.Platform;
 import com.doumee.dao.business.model.PlatformDevice;
+import com.doumee.dao.business.model.PlatformJob;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -35,6 +38,8 @@
 public class HkSyncPlatformsServiceImpl extends HkSyncBaseServiceImpl {
     @Autowired
     private PlatformMapper platformMapper;
+    @Autowired
+    private PlatformJobMapper platformJobMapper;
     @Autowired
     private PlatformDeviceMapper platformDeviceMapper;
 
@@ -65,9 +70,23 @@
             getDataChangeList(allList,allHkList,addList,deviceList,editList,deleteList,date);
             if(deleteList.size()>0){
                 //閫昏緫鍒犻櫎
+                List<Integer> platIds = new ArrayList<>();
                 for(Platform d : deleteList){
                     platformMapper.updateById(d);
+                    platIds.add(d.getId());
                 }
+                //鏇存柊鍒犻櫎鐨勬湀鍙颁俊鎭垹姝e湪鎵ц鐨勪綔涓氱姸鎬佷负銆愬緟绛惧埌銆戠姸鎬�
+                platformJobMapper.update(null,  new UpdateWrapper<PlatformJob>().lambda()
+                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
+                        .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey()
+                                ,Constants.PlatformJobStatus.WAIT_CONFIRM.getKey()
+                                ,Constants.PlatformJobStatus.DONE.getKey()
+                                ,Constants.PlatformJobStatus.LEAVED.getKey()
+                                ,Constants.PlatformJobStatus.CANCEL.getKey() )
+                        .in(PlatformJob::getPlatformId,platIds)
+                        .set(PlatformJob::getPlatformId,null)
+                        .set(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey())
+                );
             }
             if(deviceList.size()>0){
                 platformDeviceMapper.insert(deviceList);

--
Gitblit v1.9.3